18.08.2013, 09:16
Hey why i get this error with this code ?
warning 205: redundant code: constant expression is zero
C:\Users\janno\Desktop\UUS\gamemodes\Trucking.pwn( 172 : error 029: invalid expression, assumed zero
PHP код:
CMD:sc(playerid, params[])
{
new vehicle;
new ID;// wait
new Float:x,Float:y,Float:z;
if(ClassPolice == 1)return SendClientMessage(playerid, 0xffffff, "You can't use it"); //
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xffffff, "Usage: /sc [playerid]");//
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleVelocity(vehicle, x , y, z) > 50))
{
if(GetDistanceBetweenPlayers(playerid,ID) < 12)
{
new pwlvl = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid,pwlvl+1);
}
}
return 1;
}
forward Float:GetDistanceBetweenPlayers(p1,p2);
public Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
C:\Users\janno\Desktop\UUS\gamemodes\Trucking.pwn( 172 : error 029: invalid expression, assumed zero