12.01.2018, 16:04
Its only works when you are sitting in a vehicle.
I didn't test it.
I didn't test it.

Код:
new lastDriver[MAX_VEHICLES] = -1; //-1 will mean that nobody used that car bafore. public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); lastDriver[vehicleid] = playerid; } return 1; } CMD:lastdriver(playerid) { if(IsPlayerInAnyVehicle(playerid)) return 0; new vehicleid = GetPlayerVehicleID(playerid), lastString[MAX_PLAYER_NAME], _str[52]; if(lastDriver[vehicleid] != -1)// Someone already used that car: { GetPlayerName(lastDriver[vehicleid], lastString, sizeof(lastString)); format(_str,sizeof(_str),"This vehicle was used by: %s",lastString); SendClientMessage(playerid,-1,_str); }else{ SendClientMessage(playerid,-1,"Nobody has driven that car before."); } return 1; }