Jump to content

Welcome to CsTineretului.Ro @ Since 2016 !
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Plugin Quest


  • Please log in to reply
No replies to this topic

#1
OFFLINE   Fr0sTeNN

Fr0sTeNN

    Member

  • 17 posts
  • Gender:Male
  • Joc preferat:CS 1.6
  • Detinator Server CS:nu
#include <amxmodx>
#include <csx>
#include <fakemeta>
#include <fakemeta_util>
#include <cstrike>

#define MAX_MISSION    5
#define MISSION         3
#define SetBit(%0,%1) ((%0) |= (1 << (%1)))
#define ClearBit(%0,%1) ((%0) &= ~(1 << (%1))) 
#define IsSetBit(%0,%1) ((%0) & (1 << (%1)))

new IsPlayerMission[MAX_MISSION];
new IsPlayerActivate;
new g_lbz_name[MAX_MISSION][44] = {"Kill 10 Player's","Kill 15 Player's","Kill 25 Player's","Kill 35 Player's","Kill 50 Player's"}
new const MENU_ID_TITLE[] = "\yPersonal combat missions";
new IsPlayerValue[33][MAX_MISSION];
new IsRandomMission[MISSION]

public plugin_init()
{
   register_plugin("quest","1.0","?")
   register_menucmd(register_menuid(MENU_ID_TITLE), 1023, "HandleMenuMain");
   register_clcmd("say quest","HookCmd") 
   register_clcmd("say /quest","HookCmd") 
   register_clcmd("quest","HookCmd1") 
   register_clcmd("say_team quest","HookCmd") 
   GenerateMission()
} 
public HookCmd1(id)
{
   for(new i = 0;i <= MISSION - 1;i++)
   SetBit(IsPlayerMission[IsRandomMission[i]], id);
}
public client_death(Killer, victim, wpnindex, hitplace, TK)
{
   if(!is_user_connected(Killer) || !is_user_connected(victim))
      return;
   /*Any killings*/
   IsPlayerValue[Killer][0] +=1;
   switch(IsPlayerValue[Killer][0])
   {
         case 10:PlayerMissionSuccessfull(Killer,0)
         case 15:PlayerMissionSuccessfull(Killer,1)
         case 25:PlayerMissionSuccessfull(Killer,2)
         case 35:PlayerMissionSuccessfull(Killer,3)
         case 50:PlayerMissionSuccessfull(Killer,4)
      }
}
public PlayerMissionSuccessfull(PlayerID,MissionID)
{
   if(MissionAddMenu(MissionID))
   {
      SetBit(IsPlayerMission[MissionID], PlayerID);
      ColoredPrint(PlayerID, "!t[!gPersonal Quests!t]!yYou have completed the task !g%s",g_lbz_name[MissionID])
   }
}
public client_putinserver(id)
{
   for(new i = 1; i <= MAX_MISSION-1; i++)
   {
      ClearBit(IsPlayerMission[i] , id);
      IsPlayerValue[id][i]   =      0;
   }
   ClearBit(IsPlayerActivate , id);
}
public HookCmd(id)menu_lbz(id)
public menu_lbz(id)
{
   
   new Len, Menu[512],Keys = MENU_KEY_0;
   Len = formatex(Menu, charsmax(Menu), "%s ^n^n",MENU_ID_TITLE);
   for(new i = 0;i <= MISSION - 1;i++)
      Len += formatex(Menu[Len], charsmax(Menu) - Len,  "\r[\y%d\r].\y%s %s^n", i + 1,g_lbz_name[IsRandomMission[i]],IsSetBit(IsPlayerMission[IsRandomMission[i]],id) ? "\r[Performed]":"\d[Unfulfilled]")
   new szStatus[32];
   if(IsPlayerAllMision(id)&& IsSetBit(IsPlayerActivate,id))
      format(szStatus,31,"\r[Taken]")
   else if(IsPlayerAllMision(id) && !IsSetBit(IsPlayerActivate,id))
      format(szStatus,31,"\y[No interdiction]")
   else if(!IsPlayerAllMision(id))
      format(szStatus,31,"\d[Not completed]")
   if(!IsSetBit(IsPlayerActivate,id))
      Keys |= MENU_KEY_9;
   Len += formatex(Menu[Len], charsmax(Menu) - Len,  "^n^n\r[\y9\r].\yPick up the award %s^n",szStatus)
   formatex(Menu[Len], charsmax(Menu) - Len, "^n\y0. \w%s", "Exit");
   return show_menu(id, Keys, Menu, -1, MENU_ID_TITLE);
}
/*Menu Handler */
public HandleMenuMain(const id, const Key) 
{
   switch(Key) 
   {
      case 8:
      {
         if(IsPlayerAllMision(id))
         {
            ColoredPrint(id, "!t[!gPersonal Quests!t]!yYou have completed all quest and receive a reward!")
            SetBit(IsPlayerActivate,id)
                                give_item(id)
            return PLUGIN_HANDLED
         }
         else
         {
            ColoredPrint(id, "!t[!gPersonal Quests!t]!yComplete All tasks and return!")
            menu_lbz(id)
            return PLUGIN_HANDLED
         }
      }
   }
   return PLUGIN_HANDLED
}
public GenerateMission()
{
      new num[MAX_MISSION], temp, rnum;     
      for(new i=1; i<sizeof(num); i++)
      num[i] = i;
      for(new i=1; i<sizeof(num); i++)
      {
      temp = num[i];
      rnum = random_num(0, MAX_MISSION - 1);  
      num[i] = num[rnum];
      num[rnum] = temp; 
      }
      for(new i=0; i<MISSION; i++)
      IsRandomMission[i] = num[i+1];
}
MissionAddMenu(MissionID)
{
   for(new i = 0;i <= MISSION - 1;i++)
   if(MissionID==IsRandomMission[i])
   return true;
   return false; 
   }
   IsPlayerAllMision(id)
   {
   new MissionCount;
   for(new i=0; i<MISSION; i++)
   {
   if(IsSetBit(IsPlayerMission[IsRandomMission[i]], id))
      MissionCount++;
   }
   if(MissionCount==MISSION)
   return true;
   return false;
}

public give_item(id)
{
   switch (random_num(0,8)){ 
      case 0:{
         new HP;
         HP = 50;   
         fm_set_user_health(id, get_user_health(id) + HP); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] AI PRIMIT !t+ %d Health ",HP); 
       }

      case 1:{
         new HP;
         HP = 70;   
         fm_set_user_health(id, get_user_health(id) + HP); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] AI PRIMIT !t + %d Health ",HP);
      }

      case 2:{
         new HP;
         HP = 100;   
         fm_set_user_health(id, get_user_health(id) + HP); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] AI PRIMIT !t + %d Health ",HP);
      }

      case 3:{
         new MONEY;
         MONEY = 1500;   
         cs_set_user_money(id, cs_get_user_money(id) + MONEY); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d $ ", MONEY); 
      }
                
      case 4:{
         new MONEY;
         MONEY = 3000;   
         cs_set_user_money(id, cs_get_user_money(id) + MONEY); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d $ ", MONEY); 
      }
                case 5:{
         new MONEY;
         MONEY = 5000;   
         cs_set_user_money(id, cs_get_user_money(id) + MONEY); 
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d $ ", MONEY); 
      }
                case 6:{
         new ARMOR;
         ARMOR = 50;   
         cs_set_user_armor ( id, 50, CS_ARMOR_KEVLAR );
                        cs_set_user_armor ( id, 50, CS_ARMOR_VESTHELM );  
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d ARMOR", ARMOR); 
      }
                case 7:{
         new ARMOR;
         ARMOR = 70;   
         cs_set_user_armor ( id, 70, CS_ARMOR_KEVLAR );
                        cs_set_user_armor ( id, 70, CS_ARMOR_VESTHELM );
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d ARMOR", ARMOR); 
      }
                case 8:{
         new ARMOR;
         ARMOR = 100;   
                        cs_set_user_armor ( id, 100, CS_ARMOR_KEVLAR );
                        cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM );  
         ColoredPrint(id,"!g* [!tPersonal Quests!g] !yAI PRIMIT !t + %d ARMOR", ARMOR); 
      }
   }
}


stock ColoredPrint(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[512]
   vformat(msg, 512, input, 3)
   replace_all(msg, 512, "!g", "^x04")
   replace_all(msg, 512, "!y", "^x01")
   replace_all(msg, 512, "!t", "^x03")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
   for (new i = 0; i < count; i++)
   {
      if (is_user_connected(players[i]))
      {
         message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
         write_byte(players[i]);
         write_string(msg);
         message_end();
      }
   }
   }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

Odata indeplinite sarcinile (adica facute killurile) , la sfarsit o sa apara butonul de "Claim reward". De acolo iti poate pica

 

-50 , 70 sau 100 hp

-50 , 70 sau 100 ap

-1500 , 3000 sau 5000 bani

-50 , 70 sau 100 viata.


  • MariaNN #. likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users