vehicles dont get destroyed on 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: vehicles dont get destroyed on disconnect (
/showthread.php?tid=608286)
vehicles dont get destroyed on disconnect -
justjamie - 30.05.2016
hello.
i have this in my OnPlayerDisconnect, but the vehicles still don't go away.
Someone know why?
PHP код:
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x]==0)continue;
if(!strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
DestroyVehicle(cInfo[i][id_x]);
cInfo[i][id_x]=0;
}
Re: vehicles dont get destroyed on disconnect -
justjamie - 30.05.2016
if(!strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
Is this good?
It has to be like this:
Left has to be exactly the same as the right, then it destroys the vehicle and set the id_x to 0.
Re: vehicles dont get destroyed on disconnect -
jlalt - 30.05.2016
PHP код:
if(!strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
the above code checks if vehicle owner is not the same with player name, so it should be like that:
PHP код:
if(strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
Re: vehicles dont get destroyed on disconnect -
justjamie - 30.05.2016
Quote:
Originally Posted by jlalt
PHP код:
if(!strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
the above code checks if vehicle owner is not the same with player name, so it should be like that:
PHP код:
if(strcmp(Vehicles[i][carowner], PlayerName(playerid), false))continue;
|
i already thought something like that.
Thanks mate