OnVehicleDeath- killerid work?
#1

I dont know, i just made some system and i think killerid dont work.
Reply
#2

We're gonna need some more info lol
Reply
#3

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
 for(new i=0; i<MAX_PLAYERS; i++)
 {
  new str[255],str1[255];
  new giveplayer[MAX_PLAYER_NAME];
  format(str1, sizeof(str1), "Insurances/%s.ini", VehicleInfo[vehicleid][vOwner]);
  printf("Insurance/%s.ini", VehicleInfo[vehicleid][vOwner]);
  if(dini_Exists(str1))
  {
     printf("Search for..");
     if(dini_Int(str1, "Vehicle1") == vehicleid)
     {
         new ins = dini_Int(str1, "Ins1");
         insurance1[killerid] = ins-1;
         dini_IntSet(str1, "Ins1", insurance1[killerid]);
         format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance1[killerid]);
         SendClientMessage(killerid, COLOR_LIGHTRED, str1);
         printf("Success");
     }
     else if(dini_Int(str1, "Vehicle2") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins2");
        insurance2[killerid] = ins-1;
        dini_IntSet(str1, "Ins2", insurance2[killerid]);
        format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance2[killerid]);
        SendClientMessage(killerid, COLOR_LIGHTRED, str1);
        printf("Success");
     }
     else if(dini_Int(str1, "Vehicle3") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins3");
        insurance3[killerid] = ins-1;
        dini_IntSet(str1, "Ins3", insurance3[killerid]);
        format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance3[killerid]);
        SendClientMessage(killerid, COLOR_LIGHTRED, str1);
        printf("Success");
     }
     else if(dini_Int(str1, "Vehicle4") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins4");
        insurance4[killerid] = ins-1;
        dini_IntSet(str1, "Ins4", insurance4[killerid]);
        format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance4[killerid]);
        SendClientMessage(killerid, COLOR_LIGHTRED, str1);
        printf("Success");
     }
     else if(dini_Int(str1, "Vehicle5") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins5");
        insurance5[killerid] = ins-1;
        dini_IntSet(str1, "Ins5", insurance5[killerid]);
        format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance5[killerid]);
        SendClientMessage(killerid, COLOR_LIGHTRED, str1);
        printf("Success");
     }
  }
 }
}
I know the system work but dont recive any message in game. but get the Success
Reply
#4

It's always INVALID_PLAYER_ID.
Reply
#5

OT

Vehicle killerid, Tree
Reply
#6

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
 for(new i=0; i<MAX_PLAYERS; i++)
 {
  new str[255],str1[255];
  new giveplayer[MAX_PLAYER_NAME];
  new name[MAX_PLAYER_NAME];
  GetPlayerName(i, name, sizeof(name));
  format(str1, sizeof(str1), "Insurances/%s.ini", VehicleInfo[vehicleid][vOwner]);
  printf("Insurances/%s.ini", VehicleInfo[vehicleid][vOwner]);
  if(dini_Exists(str1))
  {
     printf("Search for..");
     format(str, sizeof(str), "You destroy %s's vehicle. %d | %d", VehicleInfo[vehicleid][vOwner], dini_Int(str1, "Vehicle1"), vehicleid);
     SendClientMessageToAll(COLOR_LIGHTRED, str);
     if(dini_Int(str1, "Vehicle1") == vehicleid)
     {
         new ins = dini_Int(str1, "Ins1");
         insurance1 = ins-1;
         dini_IntSet(str1, "Ins1", insurance1);
         printf("Success");
         if(strcmp(VehicleInfo[vehicleid][vOwner],name, true ) == 0 )
         {
          format(str, sizeof(str), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance1);
          SendClientMessage(i, COLOR_LIGHTRED, str);
          printf("Success2");
         }
     }
     if(dini_Int(str1, "Vehicle2") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins2");
        insurance2 = ins-1;
        dini_IntSet(str1, "Ins2", insurance2);
        printf("Success");
        if(strcmp(VehicleInfo[vehicleid][vOwner],name, true ) == 0 )
        {
        format(str, sizeof(str), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance2);
        SendClientMessage(i, COLOR_LIGHTRED, str);
        printf("Success2");
        }
     }
     if(dini_Int(str1, "Vehicle3") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins3");
        insurance3 = ins-1;
        dini_IntSet(str1, "Ins3", insurance3);
        printf("Success2");
        if(strcmp(VehicleInfo[vehicleid][vOwner],name, true ) == 0 )
        {
        format(str, sizeof(str), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance3);
        SendClientMessage(i, COLOR_LIGHTRED, str);
        printf("Success");
        }
     }
     if(dini_Int(str1, "Vehicle4") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins4");
        insurance4 = ins-1;
        dini_IntSet(str1, "Ins4", insurance4);
        printf("Success");
        if(strcmp(VehicleInfo[vehicleid][vOwner],name, true ) == 0 )
        {
        format(str, sizeof(str), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance4);
        SendClientMessage(i, COLOR_LIGHTRED, str1);
        printf("Success2");
        }
     }
     if(dini_Int(str1, "Vehicle5") == vehicleid)
     {
        new ins = dini_Int(str1, "Ins5");
        insurance5 = ins-1;
        dini_IntSet(str1, "Ins5", insurance5);
        printf("Success");
        if(strcmp(VehicleInfo[vehicleid][vOwner],name, true ) == 0 )
        {
        format(str, sizeof(str), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance5);
        SendClientMessage(i, COLOR_LIGHTRED, str);
        printf("Success2");
        }
     }
  }
 }
}
unknown problem.. i get the message "Search for", get the message of you destory .. %d %d is the same number but its not compares between values.. idk what the problem hope someone will know,,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)