Raised This Month: $ Target: $400
 0% 

[SOLVED]get_pcvar_string compile error?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 08-18-2010 , 18:58   [SOLVED]get_pcvar_string compile error?
Reply With Quote #1

PHP Code:

// plugin_init()
cvar_bodyguard_weapon register_cvar("zp_bodyguard_weapon""deagle")
// end

// zp_round_started(gamemode, iRandomPlayer)
new sz_WeaponName[7]
get_pcvar_string(cvar_bodyguard_weaponsz_WeaponNamecharsmax(sz_WeaponName))

give_item(iRandomPlayer"weapon_%s"sz_WeaponName
I get an error.

Code:
Error: Number of arguments does not match definition
This line is giving me the compile error.
give_item(iRandomPlayer, "weapon_%s", sz_WeaponName)

Last edited by Excalibur.007; 08-19-2010 at 09:20.
Excalibur.007 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-18-2010 , 19:05   Re: get_pcvar_string compile error?
Reply With Quote #2

give_item needs a constant string as 2nd argument, you need to format it before.

Tip :

PHP Code:
new sz_WeaponName[20] = "weapon_"
get_pcvar_string(cvar_bodyguard_weaponsz_WeaponName[7], charsmax(sz_WeaponName)-7)

give_item(iRandomPlayersz_WeaponName
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 08-19-2010 , 09:15   Re: get_pcvar_string compile error?
Reply With Quote #3

Ohh. A new thing! Thanks. Works for me now. Title changed to [SOLVED]
Excalibur.007 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 21:56.


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