10.04.2011, 15:14
I don't particularly understand the logic in use here. What are you trying to achieve? If you want to check if the vehicle ID of the player matches the vehicle ID stored in "rentbic" then there's no need for a loop, just:
You may also want to know that the variable is only going to be storing the vehicle ID of the last vehicle, so only the last moutain bike will match in the if statement. I suggest either having an array or simply checking the model of the vehicle if you want it to do this for all mountain bikes!
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == rentbic)
{
if(GetPVarInt(rentbic, "BicRentan") == 0)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Upisite '/iznajmi 3' ~n~kako biste iznajmili ~n~ovaj bicikl za 10$!", 5000, 4);
}
}
}
return 1;
}