vehicles dont get destroyed on disconnect
#1

hello.
i have this in my OnPlayerDisconnect, but the vehicles still don't go away.
Someone know why?


PHP код:
for(new i=0i<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;
    } 
Reply
#2

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.
Reply
#3

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; 
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)