18.09.2015, 15:45
PHP код:
new PlayerIDCar[MAX_VEHICLES];
new playercar[MAX_PLAYERS];
playercar[playerid] = CreateVehicle(411,0,0,0,2,-1,-1,3600);
PlayerIDCar[playercar[playerid] ] = playerid;
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid==playercar[playerid])
{
SendClientMessage(playerid,-1,This is your car!);
}
else
{
new str[128];
format(str,sizeof(str),"This car is owned by %s",PlayerName(PlayerIDCar[vehicleid ] ) )
SendClientMessage(playerid,-1,str);
}
}
OnPlayerDisconnect(playerid)
{
if(IsValidVehicle(playercar[playerid])
DestroyVehicle(playercar[playerid]);
}