Raised This Month: $ Target: $400
 0% 

Simple Armor Giver


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
LOLZEYE
Member
Join Date: Dec 2008
Location: AMXx Studio
Old 12-12-2009 , 16:47   Simple Armor Giver
Reply With Quote #1

Armor Giver


Hello,my first small plugin

Name: ArmorGiver
Version : 0.1
Author:LordLolzeye


Description:
A simple plugin to give player armor.

Instalation:
Put the .amxx file into cstrike/addons/amxmodx/plugins
Then go to cstrike/addons/amxmodx/configs/plugins.ini and write the line
armorgiver.amxx

Comands:
Code:
register_concmd("amx_givearmor", "cmd_armor", ADMIN_SLAY, "<target>")
register_concmd("amx_armor", "cmd_armor", ADMIN_SLAY, "<target>")

Modules Required:
Fun


Attached Files
File Type: sma Get Plugin or Get Source (ArmorGiver.sma - 973 views - 1.8 KB)

Last edited by LOLZEYE; 12-12-2009 at 17:42.
LOLZEYE is offline
Send a message via AIM to LOLZEYE Send a message via Yahoo to LOLZEYE
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-12-2009 , 17:14   Re: Simple Armor Giver
Reply With Quote #2

use cs_set_user_armor for CS.
__________________
xPaw is offline
LOLZEYE
Member
Join Date: Dec 2008
Location: AMXx Studio
Old 12-12-2009 , 17:43   Re: Simple Armor Giver
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
use cs_set_user_armor for CS.
if i am using it,the compiling won't work
LOLZEYE is offline
Send a message via AIM to LOLZEYE Send a message via Yahoo to LOLZEYE
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-12-2009 , 18:01   Re: Simple Armor Giver
Reply With Quote #4

Add #include <cstrike>

Add cs_set_user_armor and compile.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
LOLZEYE
Member
Join Date: Dec 2008
Location: AMXx Studio
Old 12-12-2009 , 18:03   Re: Simple Armor Giver
Reply With Quote #5

done in 2 mins

@ should i leave <target>?
here i mean
register_concmd("amx_givearmor", "cmd_armor", ADMIN_SLAY, "<target>")
register_concmd("amx_armor", "cmd_armor", ADMIN_SLAY, "<target>")

+edit:
ok,now i really need some help where should i put the cs_set_user_armor? three posibilites

Last edited by LOLZEYE; 12-12-2009 at 18:08.
LOLZEYE is offline
Send a message via AIM to LOLZEYE Send a message via Yahoo to LOLZEYE
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-12-2009 , 18:17   Re: Simple Armor Giver
Reply With Quote #6

Quote:
where should i put the cs_set_user_armor
If you ask that, you should not post here because you don't have the knowledge to code nor to support it. You should read the rules.
__________________
Arkshine is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 12-12-2009 , 18:56   Re: Simple Armor Giver
Reply With Quote #7

And...

http://forums.alliedmods.net/showthread.php?t=21956
http://forums.alliedmods.net/showthread.php?t=11201
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
LOLZEYE
Member
Join Date: Dec 2008
Location: AMXx Studio
Old 12-14-2009 , 09:43   Re: Simple Armor Giver
Reply With Quote #8

Finally,i got it out how cstrike module works,but has 3 errors
/groups/amxmodx/tmp3/textqnQ0ll.sma(14) : warning 217: loose indentation
/groups/amxmodx/tmp3/textqnQ0ll.sma(23) : warning 217: loose indentation
/groups/amxmodx/tmp3/textqnQ0ll.sma(4 : error 088: number of arguments does not match definition
/groups/amxmodx/tmp3/textqnQ0ll.sma(52) : warning 213: tag mismatch
/groups/amxmodx/tmp3/textqnQ0ll.sma(54) : error 088: number of arguments does not match definition
/groups/amxmodx/tmp3/textqnQ0ll.sma(70) : error 088: number of arguments does not match definition
Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Armor Giver"
#define VERSION "0.1"
#define AUTHOR "LordLolzeye"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    
      register_concmd("amx_givearmor", "cmd_armor", ADMIN_SLAY, "<target>")
      register_concmd("amx_armor", "cmd_armor", ADMIN_SLAY, "target")
}

public cmd_armor (id, level, cid)
{
 if (!cmd_access(id, level, cid, 3))
        return PLUGIN_HANDLED

     new Arg1[24]
     new Arg2[4]

   
     read_argv(1, Arg1, 23)
     read_argv(2, Arg2, 3)
  
     new Armor = str_to_num(Arg2)

     if (Arg1[0] == '@')
     {
          new Team = 0
          if (equali(Arg1[1], "CT"))
          {
               Team = 2
          } else if (equali(Arg1[1], "T")) {
               Team = 1
          }
          new players[32], num
          get_players(players, num)
          new i
          for (i=0; i<num; i++)
          {
               if (!Team)
               {
                    cs_set_user_armor(players[i], Armor)
               } 
           else 
            {
                    if( cs_get_user_team(players[i]) == Team)
                    {
                    cs_set_user_armor(players[i], Armor)
                    }
              }
          }
     } 
     else 
     {
          new player = cmd_target(id, Arg1, 1)
          if (!player)
          {
               console_print(id, "The Player dosen't exist", Arg1)
               return PLUGIN_HANDLED
          } 
      else 
     {
               if( is_user_alive(player) )
               cs_set_user_armor(player, Armor)
          }
     }

     return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{ rtf1 ansi deff0{ fonttbl{ f0 fnil Tahoma;}}n viewkind4 uc1 pard lang1031 f0 fs16 n par }
*/
And i tried to fix it,stayed hours to find the problem,all the "{" are good all the " " are good,i cant see what is wrong,please enlight me
LOLZEYE is offline
Send a message via AIM to LOLZEYE Send a message via Yahoo to LOLZEYE
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-14-2009 , 09:45   Re: Simple Armor Giver
Reply With Quote #9

Redundant...
Author's ability to support this is questionable...

Unapproved
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Old 12-15-2009, 15:55
maki car
This message has been deleted by Exolent[jNr]. Reason: Stop spamming topics.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:45.


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