19.05.2012, 12:47
I made this:
But when i enter the vehicle it says its locked by one of my bots. How can i detect the good player who locked the vehicle?
Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver { if(Locked[GetPlayerVehicleID(playerid)] == 1) { new string[256]; new pname[256]; GetPlayerName(Locked[VehicleID[playerid]], pname, sizeof(pname)); format(string,sizeof (string),"This vehicle is locked by %s[%d]!",pname,Locked[VehicleID[playerid]]); SendClientMessage(playerid,COLOR_RED,string); RemovePlayerFromVehicle(playerid); } else { VehicleID[playerid] = GetPlayerVehicleID(playerid); } }