07.02.2010, 13:06
You can't use format operators in SendClientMessage(ToAll).
Also, I'm assuming by 531 you mean modelid, not vehicleid, so here's the correct solution.
Also, I'm assuming by 531 you mean modelid, not vehicleid, so here's the correct solution.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128],
name[MAX_PLAYER_NAME],
modelid = GetVehicleModel(vehicleid);
if(modelid == 531)
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s entered the tractor",name);
SendClientMessageToAll(COLOR_ENTERVEH,string);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
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;
}