AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help points for bomb planted (https://forums.alliedmods.net/showthread.php?t=282417)

Tatu Eugen 05-06-2016 14:53

Help points for bomb planted
 
Hello i have a plugin and when you kill someone you get +1 point and save it in a file from amxmodx folder, and i whant to make when you plant the bomb you get +25 points with public bomb_planted , down here is the code for +1 point for kill.

Thanks guys... :oops:

Code:

public client_death(Killer, Victim)
{
  if(Killer == Victim)
      return PLUGIN_HANDLED;
 
  Kills[Killer]++;
 
  if(Rang[Killer] < sizeof(Rangs) && Rang[Killer] < file_size(RangFile, 1)-1)
      if(Kills[Killer] >= NeedKills[Rang[Killer]])
        Rang[Killer]++;
 
  new pPont, Name[32];
 
  pPont += random_num(PointsMin, PointsMax);
  Points[Killer] += pPont;
 
  set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 6.0, 2.0);
  show_hudmessage(Killer, "+%d Points", pPont);
 
 
  if(Drop >= random_num(1, 100))
  {
      get_user_name(Killer, Name, 31);
      new x = random_num(1, 2);
      if(x == 1)
      {
        pKey[Killer]++;
        print_color(0, "!g%s!t %s !y found !gItem1!y!", Prefix, Name);
      }
      if(x == 2)
      {
        Chest[Killer]++;
        print_color(0, "!g%s!t %s!y found !gItem2!y!", Prefix, Name);
      }
  }
  Save(Killer);
  return PLUGIN_CONTINUE;
}


wickedd 05-06-2016 16:20

Re: Help points for bomb planted
 
Read this

OciXCrom 05-06-2016 16:52

Re: Help points for bomb planted
 
Simply add #include <csx> and the function:

PHP Code:

public bomb_planted(id)
{
    
Points[id] += 25
    Save
(id)



siriusmd99 05-06-2016 17:45

Re: Help points for bomb planted
 
Points[id]++ means that you add 1 point to the player, if you want 25 points then you do:

Points[id]+=25

OciXCrom 05-06-2016 18:14

Re: Help points for bomb planted
 
I misread the question. My bad.


All times are GMT -4. The time now is 18:43.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.