SA-MP Forums Archive
Help with OnVehicleDeath - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with OnVehicleDeath (/showthread.php?tid=109794)



Help with OnVehicleDeath - Toney - 22.11.2009

Hi. I have problem with it. I need get player id for check if player have some value 1 or 0. So when car destroyed, i have no effect, no messages, nothing. Why?
Code:

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
  for(new x = 0; x < MAX_PLAYERS; x++)
  {
   if(IsPlayerConnected(x))
    {
      new i;
      for(i=0; i<sizeof(Carlist); i++)
      {
          if(Carlist[i][Carid]==vehicleid)
          {
            if(PlayerInfo[x][pCarLive] != 1)//
            {
            SendClientMessage(x, COLOR_LIGHTRED, "[ ! ] Yes you got it. GL.");
            DestroyVehicle(Carlist[i][Carid]); //
            Carlist[i][Carid]=CreateTunedCar(i); //
            return 1;
            }
            else //If 0
             {
        SendClientMessage(x, COLOR_LIGHTRED, "[ ! ] You dont have it. Bb with you car.");
                DestroyVehicle(Carlist[i][Carid]); //
                NULLCar(i);//
            }
         }
       }
    }
  }
}
Regards.