AlliedModders

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

paulw 11-19-2011 07:45

Weapon problem
 
Hi, I have a small problem. When i try to compile I get "error 035: argument type mismatch (argument 2)" on the last line. If there's anyone who knows why it doesn't work please let me know:)
PHP Code:

    new cswWeapon[32];
    
format(cswWeapon31"csw_%s"szProp1);
    
strtoupper(cswWeapon); 
    
    if(!
user_has_weapon(idcswWeapon)) 


Torge 11-19-2011 07:49

Re: Weapon problem
 
Try to change

PHP Code:

format(cswWeapon31"csw_%s"szProp1); 

to

PHP Code:

format(cswWeapon32"csw_%s"szProp1); 

Hope it works ;)

Arkshine 11-19-2011 07:50

Re: Weapon problem
 
The second argument of user_has_weapon is not a string, but an integer : CSW_* , like CSW_DEAGLE.

paulw 11-19-2011 08:02

Re: Weapon problem
 
Torge: didn't work

Arkeshire: But how do I fix it? Is there any other functions i can use? It must be a variable because the client types the name of the weapon.

Arkshine 11-19-2011 08:13

Re: Weapon problem
 
http://www.amxmodx.org/funcwiki.php?go=func&id=1081


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

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