Need a help
#1

Hello,

Код:
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
    return floatround(ST[3]);
}
public OnPlayerUpdate(playerid)
{
    if(GetPlayerSpeed > 160) return Kick(playerid);
    return 1;
}
I get that:
Код:
G:\Disque Local [E]\samp\gamemodes\lvdm.pwn(1412) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Try this
Код:
stock GetPlayerSpeed(playerid)
{
  new Float:x,Float:y,Float:z;
  if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
else
GetPlayerVelocity(playerid,x,y,z);
return floatround((ServerVariables[SPEED_3D]?floatsqroot(x*x+y*y+z*z):floatsqroot(x*x+y*y))*100.0*1.6);
}
Reply
#3

Doesn't work

The Problem is here :

Код:
if(GetPlayerSpeed > /*How i can add the speed limit ?) return Kick*/(playerid);
Reply
#4

pawn Код:
if(GetPlayerSpeed(playerid) > 160) return Kick(playerid);
you forgot the playerid
Reply
#5

Ohh! Thanks =D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)