Help with OnVehicleDeath
#1

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


Forum Jump:


Users browsing this thread: 1 Guest(s)