undefined symbol "playerid". -
TaLhA XIV - 23.08.2012
PHP код:
public OnPlayerConnect(playerid)
{
SetTimer("test",360000,true);
return 1;
}
public test()
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2802.2390,-474.2502,7.1875))
{
new vid = GetPlayerVehicleID(playerid);
{
//codes
}
}
}
Errors:
PHP код:
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(90) : error 017: undefined symbol "playerid"
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(92) : error 017: undefined symbol "playerid"
The error lines are the lines with the range and the vid((which defines vid.))
Re: undefined symbol "playerid". -
Sielly - 23.08.2012
use this:
Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("test", 360000, true, "i", playerid);
return 1;
}
public test(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2802.2390,-474.2502,7.1875))
{
new vid = GetPlayerVehicleID(playerid);
{
//codes
}
}
}
Re: undefined symbol "playerid". -
TaLhA XIV - 23.08.2012
PHP код:
forward GetVehicleSpeed(vehicleid, unit);
forward test(playerid);
/*=========================Callbacks=========================*/
public GetVehicleSpeed(vehicleid, unit)
{
new
Float:x_speed, Float:y_speed, Float:z_speed, Float:speedf, speed;
GetVehicleVelocity(vehicleid,x_speed,y_speed,z_speed);
if(unit == kmh)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 187.666667;
}
else if(unit == mph)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 116.541;
}
speed = floatround(speedf,floatround_round);
return speed;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("test", 360000, true, "i", playerid);
return 1;
}
public test(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2802.2390,-474.2502,7.1875))
{
new v = GetPlayerVehicleID(playerid);
GetVehicleSpeed(v,kmh);
if(GetVehicleSpeed(GetPlayerVehicleID(playerid),>50))
{
SendClientMessage(playerid,-1,"Speed kam kar oye!");
GivePlayerMoney(playerid,-100);
}
}
}
Errors:
PHP код:
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 029: invalid expression, assumed zero
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : warning 215: expression has no effect
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 001: expected token: ";", but found ")"
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 029: invalid expression, assumed zero
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
HeLp!
Re: undefined symbol "playerid". -
.FuneraL. - 23.08.2012
pawn Код:
forward GetVehicleSpeed(vehicleid, unit);
forward test(playerid);
/*=========================Callbacks=========================*/
public GetVehicleSpeed(vehicleid, unit)
{
new
Float:x_speed, Float:y_speed, Float:z_speed, Float:speedf, speed;
GetVehicleVelocity(vehicleid,x_speed,y_speed,z_speed);
if(unit == kmh)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 187.666667;
}
else if(unit == mph)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 116.541;
}
speed = floatround(speedf,floatround_round);
return speed;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("test", 360000, true, "i", playerid);
return 1;
}
public test(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2802.2390,-474.2502,7.1875))
{
new v = GetPlayerVehicleID(playerid);
GetVehicleSpeed(v,kmh);
if(GetVehicleSpeed(GetPlayerVehicleID(playerid) > 50))
{
SendClientMessage(playerid,-1,"Speed kam kar oye!");
GivePlayerMoney(playerid,-100);
}
}
}
Try This.
Re: undefined symbol "playerid". -
TaLhA XIV - 23.08.2012
Thanks but tell me what did you exactly changed,thanks for the help.
Re: undefined symbol "playerid". -
.FuneraL. - 23.08.2012
Removed the last comma in if.
Old Code:
pawn Код:
if(GetVehicleSpeed(GetPlayerVehicleID(playerid), > 50))
New Code:
pawn Код:
if(GetVehicleSpeed(GetPlayerVehicleID(playerid) > 50))
Re: undefined symbol "playerid". -
clarencecuzz - 23.08.2012
EDIT: Too late
Re: undefined symbol "playerid". -
TaLhA XIV - 24.08.2012
PHP код:
forward GetVehicleSpeed(vehicleid, unit);
forward test(playerid);
/*=========================Callbacks=========================*/
public GetVehicleSpeed(vehicleid, unit)
{
new
Float:x_speed, Float:y_speed, Float:z_speed, Float:speedf, speed;
GetVehicleVelocity(vehicleid,x_speed,y_speed,z_speed);
if(unit == kmh)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 187.666667;
}
else if(unit == mph)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 116.541;
}
speed = floatround(speedf,floatround_round);
return speed;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("test", 360000, true, "i", playerid);
return 1;
}
public test(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2810.6204,-459.6523,6.8550))
{
new v = GetPlayerVehicleID(playerid);
GetVehicleSpeed(v,kmh);
if(GetVehicleSpeed(GetPlayerVehicleID(playerid) > 50))
{
SendClientMessage(playerid,-1,"Speed kam kar oye!");
GivePlayerMoney(playerid,-100);
}
}
}
When I go IG and pass the coordinates,nothing happens?
Re: undefined symbol "playerid". -
Kirollos - 24.08.2012
decrease the timer here
SetTimerEx("test", 360000, true, "i", playerid);
make it like
SetTimerEx("test", 10000, true, "i", playerid);