SA-MP Forums Archive
playerid not defined? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: playerid not defined? (/showthread.php?tid=119528)



playerid not defined? - Mattjones17 - 08.01.2010

Hi
with the following I am told that playerid is not defined

public CheckBusEntry()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(PlayerToPoint(5.0, i, -1756.983765, 752.805664, 23.990942) && c_bus_entry_status == 0 && GetVehicleModel(vehicle) == 431 || GetVehicleModel(vehicle) == 437 || GetVehicleModel(vehicle) == 525)
{
MoveObject(c_bus_entry, -1756.983765, 752.805664, 22.915958, 0.5);
Update3DTextLabelText(Text3D:bus_entry_sign, 0x00FF00FF, "ONE VEHICLE MAY PROCEED MAX 10MPH");
c_bus_entry_status = 1;
}
else if(!PlayerToPoint(5.0, i, -1756.983765, 752.805664, 23.990942) && c_bus_entry_status == 1)
{
MoveObject(c_bus_entry, -1756.983765, 752.805664, 23.990942, 0.5);
Update3DTextLabelText(Text3D:bus_entry_sign, 0xFF0000FF, "Buses only beyond this point.");
c_bus_entry_status = 0;
}
}
}

I thought you did not have to define playerid. Any help on this weird error would be appreciated


Re: playerid not defined? - Correlli - 08.01.2010

Change:
pawn Код:
vehicle = GetPlayerVehicleID(playerid);
to:
pawn Код:
vehicle = GetPlayerVehicleID(i);



Re: playerid not defined? - Mattjones17 - 08.01.2010

tried that - it compiles but doesnt work ingame


Re: playerid not defined? - Mattjones17 - 08.01.2010

fixed,thanks