GetPlayerSpeed help.
#1

Hmmm, I'm trying to make it so players cant score farm, using GetPlayerSpeed, this is only basic becuse it will be replaced with a /work system, but can you guys help me?

I am using this stock.

pawn Код:
stock GetPlayerSpeed(playerid,bool:kmh) // by misco
{
  new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
  rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
  return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
So, I tried a couple of things in the score system.

pawn Код:
forward ScoreSystem( );
public ScoreSystem( )
{
    foreach(Player,i)
    {
        if(IsPlayerInPlane(i) && GetPlayerSpeed(i, > 50))
        {
            GivePlayerMoney(i,2000);
            SetPlayerScore(i,GetPlayerScore(i) + 1);
            SendClientMessage(i, COLOR_RED, "One flying minute. 1 Score + 2k cash.");
        }
    }
And this

pawn Код:
forward ScoreSystem( );
public ScoreSystem( )
{
    foreach(Player,i)
    {
        if(IsPlayerInPlane(i) && GetPlayerSpeed(i, = > 50))
        {
            GivePlayerMoney(i,2000);
            SetPlayerScore(i,GetPlayerScore(i) + 1);
            SendClientMessage(i, COLOR_RED, "One flying minute. 1 Score + 2k cash.");
        }
    }
}
But I keep getting theese errors

Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : warning 215: expression has no effect
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Any ideas?
Reply
#2

Line of error?
Reply
#3

pawn Код:
if(IsPlayerInPlane(i) && GetPlayerSpeed(i, = > 50))
&

pawn Код:
if(IsPlayerInPlane(i) && GetPlayerSpeed(i, > 50))
Prety obvious lol.
Reply
#4

pawn Код:
if(IsPlayerInPlane(i) && GetPlayerSpeed(i, true) > 50)
Reply
#5

Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(244) : warning 213: tag mismatch
Reply
#6

if(IsPlayerInPlane(i) && GetPlayerSpeed(i) > 50)
Reply
#7

Last post edited, sorry misread it earlier.
Reply
#8

pawn Код:
forward ScoreSystem( );
public ScoreSystem( )
{
    foreach(Player,i)
        if(IsPlayerInPlane(i) && GetPlayerSpeed(i, > 50))
        {
            GivePlayerMoney(i,2000);
            SetPlayerScore(i,GetPlayerScore(i) + 1);
            SendClientMessage(i, COLOR_RED, "One flying minute. 1 Score + 2k cash.");
        }
        return 1;
}
Reply
#9

With Vinces line:

Код:
C:\Documents and Settings\Ed\My Documents\SA-MP Virtual Pilots\Server\filterscripts\AircraftSystems.pwn(245) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
System64 just made a repost of my old script.
Reply
#10

>= not = >
if(IsPlayerInPlane(i) && GetPlayerSpeed(i, = > 50))

like that

if(IsPlayerInPlane(i) && GetPlayerSpeed(i, >= 50))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)