SA-MP Forums Archive
Deleting car when player disconnect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Deleting car when player disconnect (/showthread.php?tid=495192)



Deleting car when player disconnect - TexZena - 16.02.2014

hello, i have a problem.
When i disconnect i wanna to delete my own car, this is the code, but doesn't works...

Код:
public OnPlayerDisconnect(playerid, reason)
{
    
    PlayerInfo[ playerid ][pduty] = 0;
	SaveAccountStats(playerid);
	
    new name[MAX_PLAYER_NAME+1];
    
    if( VehicleInfo[playerid][vOwn] == GetPlayerName(playerid, name, sizeof(name)))
        {
            DestroyVehicle(VehicleInfo[playerid][vModel]);
        }
        
 
  

	
    return 1;
}
Код:
enum vInfo 
{
    vID,
    vModel,
    Float:vPos_x,
	Float:vPos_y,
	Float:vPos_z,
	vOwn,
  	vColor1,
    vColor2,
    
}
new VehicleInfo[MAX_VEHICLES][vInfo];



Re: Deleting car when player disconnect - Necip - 16.02.2014

Does it give you any errors or warnings? If yes, post them here.


Re: Deleting car when player disconnect - TexZena - 16.02.2014

no..


Re: Deleting car when player disconnect - TexZena - 16.02.2014

up!!