AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Announceing (https://forums.alliedmods.net/showthread.php?t=65124)

jageassyrian 01-01-2008 18:24

Announceing
 
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")

kp_uparrow 01-01-2008 18:54

Re: Announceing
 
new name[32]
get_user_name(player,name,31)

client_print(0, print_chat, "%s got a awp with 3 bullets!",name)

jageassyrian 01-01-2008 22:43

Re: Announceing
 
where do i place that in the code

Sn!ff3r 01-02-2008 05:43

Re: Announceing
 
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


jageassyrian 01-02-2008 12:31

Re: Announceing
 
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(1678) : 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).

YamiKaitou 01-02-2008 12:41

Re: Announceing
 
Posting the code would help if you want those errors fixed

jageassyrian 01-02-2008 12:54

Re: Announceing
 
well its not mine i am just working on a dead plugin is it ok to post it?

slypanther 01-09-2008 12:50

Re: Announceing
 
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


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

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