Raised This Month: $ Target: $400
 0% 

Announceing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-01-2008 , 18:24   Announceing
Reply With Quote #1

Well i amd remaking a chance mod for cs hns, and i would like it to announce once a player gets the weapon for example. what do i add to this code so when the user gets the gun it announces to everyone

if(random_num(0, 100) <= 3)
{
give_item(player,"weapon_awp");
new weapon_id = find_ent_by_owner(-1, "weapon_awp", player);
cs_set_weapon_ammo(weapon_id, 3);
client_print(player, print_chat, "You were lucky, you got a awp with 3 bullets")
jageassyrian is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-01-2008 , 18:54   Re: Announceing
Reply With Quote #2

new name[32]
get_user_name(player,name,31)

client_print(0, print_chat, "%s got a awp with 3 bullets!",name)
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-01-2008 , 22:43   Re: Announceing
Reply With Quote #3

where do i place that in the code
jageassyrian is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 01-02-2008 , 05:43   Re: Announceing
Reply With Quote #4

Quote:
where do i place that in the code
Where do you want...

ex
PHP Code:
 if(random_num(0100) <= 3)
{
                                new 
name[32]
give_item(player,"weapon_awp");
new 
weapon_id find_ent_by_owner(-1"weapon_awp"player);
get_user_name(player,name,31)
cs_set_weapon_ammo(weapon_id3);
client_print(playerprint_chat"You were lucky, you got a awp with 3 bullets"
client_print(0print_chat"%s got a awp with 3 bullets!",name
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-02-2008 , 12:31   Re: Announceing
Reply With Quote #5

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpmoKsQB.sma(1675) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpmoKsQB.sma(167 : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpmoKsQB.sma(1735) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpmoKsQB.sma(1735) : error 017: undefined symbol "round_start"
/home/groups/amxmodx/tmp3/phpmoKsQB.sma(1739) : error 001: expected token: "}", but found "-end of file-"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpmoKsQB.amx (compile failed).

Last edited by jageassyrian; 01-02-2008 at 12:35.
jageassyrian is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-02-2008 , 12:41   Re: Announceing
Reply With Quote #6

Posting the code would help if you want those errors fixed
__________________
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
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-02-2008 , 12:54   Re: Announceing
Reply With Quote #7

well its not mine i am just working on a dead plugin is it ok to post it?
jageassyrian is offline
slypanther
BANNED
Join Date: Jan 2008
Old 01-09-2008 , 12:50   Re: Announceing
Reply With Quote #8

Look
PHP Code:
 if(random_num(0100) <= 3)
{
                                new 
name[32]
give_item(player,"weapon_awp");
new 
weapon_id find_ent_by_owner(-1"weapon_awp"player);
get_user_name(player,name,31)
cs_set_weapon_ammo(weapon_id3);
client_print(playerprint_chat"You were lucky, you got a awp with 3 bullets"
client_print(0print_chat"%s got a awp with 3 bullets!",name
     }



You needed a closing Bracket at end
slypanther 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 11:11.


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