07.02.2010, 13:31
Just use OnPlayerStateChange cellback:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new string[128],
name[MAX_PLAYER_NAME],
modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(modelid == 531)
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s entered the tractor",name);
SendClientMessageToAll(COLOR_ENTERVEH,string);
}
}
if(newstate == PLAYER_STATE_ONFOOT)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
new string[128],
name[MAX_PLAYER_NAME],
modelid = GetVehicleModel(vehicleid);
if(modelid == 531)
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s left the tractor",name);
SendClientMessageToAll(COLOR_ENTERVEH,string);
}
}
}
return 1;
}

