Quote:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new string[128]; if(Cars[GetPlayerVehicleID(playerid)][cOwned] == 0) { format(string,sizeof(string),"[ ! ] ID : %d ' %s ' Price : %d RCASH",GetPlayerVehicleID(playerid),Cars[GetPlayerVehicleID(playerid)][cDescription],Cars[GetPlayerVehicleID(playerid)][cPrice]); SendClientMessage(playerid,COLOR_GREY,string); return 0; } if(Cars[GetPlayerVehicleID(playerid)][cOwned] == 1) { format(string,sizeof(string),"[ ! ] ID : %d ' %s ' Bought by : %s",GetPlayerVehicleID(playerid),Cars[GetPlayerVehicleID(playerid)][cDescription],Cars[GetPlayerVehicleID(playerid)][cOwner]); SendClientMessage(playerid,COLOR_GREY,string); return 0; } return 1; }
|
Edit all GetPlayerVehicleID(playerid) to vehicleid.
Or again, code in OnPlayerStateChange(PLAYER_STATE_DRIVER) is better, cuz OnPlayerEnterVehicle doesn't get called when using PutPlayerInVehicle or hack in vehicle.