26.01.2012, 16:52
That will call the function immediatly when a player is in a radius of a vehicle and trying to enter it. (presses enter or F)
I recommend a usage of OnPlayerStateChange:
I recommend a usage of OnPlayerStateChange:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new pName[24]; GetPlayerName(playerid,pName,24);
if( (!strcmp(pName,"NuckFuts")) && (GetPlayerVehicleID(playerid) == NuckFuts))
{
//....
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,-1,"This car is payed and reserved for NuckFuts!");
}
}
return 1;
}