playerid not defined?
#1

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
Reply
#2

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

tried that - it compiles but doesnt work ingame
Reply
#4

fixed,thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)