how to make:when player spawn a car and when he dissconect to car dissapear ?
#1

I want when player spawn a car and when he dissconect, his car dissapear
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    new veh;
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    veh = CreateVehicle(451, x,y,z,0,1,1,0); //This will spawn turismo
    PutPlayerInVehicle(playerid,veh,0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new veh;
    veh = GetPlayerVehicleID(playerid);
    DestroyVehicle(veh);
    return 1;
}

This would destroy players vehicle when he disconnects (his current vehicle). Do you want maybe to delete the car that he made?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)