Raised This Month: $51 Target: $400
 12% 

Number of Bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
platEE
Member
Join Date: Jul 2008
Location: Finland, Kuopio
Old 09-30-2008 , 00:35   Number of Bullets
Reply With Quote #1

Hey im making new Awp vs. Machine gun mod and now trying to at 2 bullets to awp and 20 bullets to Machine gun but i dont know that code ?!? heres my source code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#define PLUGIN "platEE"
#define VERSION "1.0"
#define AUTHOR "author"
 
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Spawn,"player","ham_player_spawn",1)
}
 
public 
ham_player_spawn(iClient)
{
 new 
CsTeams:team cs_get_user_team(iClient)
 if (
team == CS_TEAM_T)
 {
  
strip_user_weapons(iClient)
  
give_item(iClient"weapon_awp")
    }

+ karma if someone helps
(And looking for other ideas to this plugin like grenades,etc... or other functions=))
__________________
ALWAYS leave your name when giving +Karma

Last edited by platEE; 09-30-2008 at 00:52.
platEE is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-30-2008 , 17:15   Re: Number of Bullets
Reply With Quote #2

cs_get_user_bpammo
cs_get_weapon_ammo
cs_set_user_bpammo
cs_set_user_weapon_ammo

CS Weapon Constants:
Code:
CSW_P228        1
CSW_SCOUT        3
CSW_HEGRENADE        4
CSW_XM1014        5
CSW_C4            6
CSW_MAC10        7
CSW_AUG            8
CSW_SMOKEGRENADE    9
CSW_ELITE        10
CSW_FIVESEVEN        11
CSW_UMP45        12
CSW_SG550        13
CSW_GALIL        14
CSW_FAMAS        15
CSW_USP            16
CSW_GLOCK18        17
CSW_AWP            18
CSW_MP5NAVY        19
CSW_M249        20
CSW_M3            21
CSW_M4A1        22
CSW_TMP            23
CSW_G3SG1        24
CSW_FLASHBANG        25
CSW_DEAGLE        26
CSW_SG552        27
CSW_AK47        28
CSW_KNIFE        29
CSW_P90            30
CSW_VEST        31
CSW_VESTHELM        32
That probably is enough to experiment with for now. ^^

EDIT: Just saw it: You will need this for setting/getting clip ammo:
new weapon_id = find_ent_by_owner(-1, "weapon_m4a1", id);
if(weapon_id) { // True if user has that weapon
cs_set_weapon_ammo(weapon_id, 123);
}
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 09-30-2008 at 17:21.
Silencer123 is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 09-30-2008 , 19:32   Re: Number of Bullets
Reply With Quote #3

off > Bullets entity name is bullet?
__________________

padilha007 is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 09-30-2008 , 19:35   Re: Number of Bullets
Reply With Quote #4

offtopic: platee please change ur "location" it stretches out your box where your username/avatar is and we have to scroll over just to see your post.
PvtSmithFSSF is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-01-2008 , 06:57   Re: Number of Bullets
Reply With Quote #5

Quote:
Originally Posted by PvtSmithFSSF View Post
offtopic: platee please change ur "location" it stretches out your box where your username/avatar is and we have to scroll over just to see your post.
Doesn't happen here. I'm using Firefox.

On another note...

#define PLUGIN "platEE" // here should be your plugin's name
#define VERSION "1.0"
#define AUTHOR "author // It should say "platEE" here
__________________
EAT YOUR VEGGIES
Silencer123 is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-01-2008 , 07:30   Re: Number of Bullets
Reply With Quote #6

PHP Code:
if(player_gets_awp)
{
     
give_item(idCSW_AWP)
     
cs_set_weapon_ammo(id182)
     
cs_set_user_bpammo(idCSW_AWP0)
}
else if(
player_gets_M249)
{
     
give_item(idCSW_M249)
     
cs_set_weapon_ammo(id2020)
     
cs_set_user_bpammo(idCSW_M2490)

__________________
minimiller is offline
Send a message via MSN to minimiller
platEE
Member
Join Date: Jul 2008
Location: Finland, Kuopio
Old 10-01-2008 , 08:57   Re: Number of Bullets
Reply With Quote #7

This is not needed anymore^^ xPaw helped alrdy thanks anyway
__________________
ALWAYS leave your name when giving +Karma
platEE is offline
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 20:14.


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