10.04.2011, 16:01
Ok now i figured out what is it but i dont know how to solve problem :P i put for 2 models of vehicles (mountain bike and bus) for bus i am put RemovePlayerFromVehicle, but, when i go to renbic, server do all of that what i write for bus and for bikes, so i am write for bus that if you are not bus driver you are removed from bus, and i am write for bikes that if is rent that you can rent it. But now if i go into the bus i will recive message for bikes (that i can rent it) and i will be removed, and i will be controllable 0, here is code for all of that:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i;i<MAX_VEHICLES;i++)
{
if(i == bus)
{
if(GetPVarInt(playerid, "VozacAutobusa") == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, ""#ZELENA"SONY RP:"#PLAVA"Niste vozac autobusa pa nemozete voziti autobus!");
}
}
else if(i == 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;
}