Guten Morgen erst einmal,
Ich habe mein ErmittleGeschwindigkeit ma debuggt aber es kommt nix in der Console hir der code:
stock ErmittleGeschwindigkeit(playerid,bool:kmh)
{
new Float:x,Float:y,Float:z,Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); else GetPlayerVelocity(playerid,x,y,z);
print("ErmittleGeschwindigkeit aktive von Player");
rtn = floatsqroot(x*x+y*y+z*z);
return kmh ? floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
{
new Float:x,Float:y,Float:z,Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); else GetPlayerVelocity(playerid,x,y,z);
print("ErmittleGeschwindigkeit aktive von Player");
rtn = floatsqroot(x*x+y*y+z*z);
return kmh ? floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Und wird der Blitzer über dem Boden erstellt hir der code:
stock AddBlitzer(playerid,speed,radius,name[128])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < sizeof(Blitzer); i++)
{
if(Blitzer[i][Erstellt] == 0)
{
Blitzer[i][BlitzerX] = x;
Blitzer[i][BlitzerY] = y;
Blitzer[i][BlitzerZ] = z;
Blitzer[i][Geschwindigkeit] = speed;
Blitzer[i][BlitzerName] = name;
Blitzer[i][Radius] = radius;
Blitzer[i][Erstellt] = 1;
if(!IsPlayerInAnyVehicle(playerid)) {
Blitzer[i][ID] = CreateObject(18880, x+1,y,z,0.0,0.0,0);
} else {
TogglePlayerControllable(playerid,0);
}
return 1;
}
}
return 0;
}
ocmd:blitzer(playerid, params[])
{
new speed, radius, name[128];
if (sscanf(params, "iis", speed, radius,name))return SendClientMessage(playerid, 0xffffffff, "[Benutzung]: /blitzer [Geschwindigkeit] [Radius] [Name Des Blitzers(Standort)]");
AddBlitzer(playerid,speed,radius,name);
return 1;
}
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < sizeof(Blitzer); i++)
{
if(Blitzer[i][Erstellt] == 0)
{
Blitzer[i][BlitzerX] = x;
Blitzer[i][BlitzerY] = y;
Blitzer[i][BlitzerZ] = z;
Blitzer[i][Geschwindigkeit] = speed;
Blitzer[i][BlitzerName] = name;
Blitzer[i][Radius] = radius;
Blitzer[i][Erstellt] = 1;
if(!IsPlayerInAnyVehicle(playerid)) {
Blitzer[i][ID] = CreateObject(18880, x+1,y,z,0.0,0.0,0);
} else {
TogglePlayerControllable(playerid,0);
}
return 1;
}
}
return 0;
}
ocmd:blitzer(playerid, params[])
{
new speed, radius, name[128];
if (sscanf(params, "iis", speed, radius,name))return SendClientMessage(playerid, 0xffffffff, "[Benutzung]: /blitzer [Geschwindigkeit] [Radius] [Name Des Blitzers(Standort)]");
AddBlitzer(playerid,speed,radius,name);
return 1;
}
Danke im vorraus
mfg. Fabi.StaR