AlliedModders

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

shadowstalker 04-07-2006 10:03

compiling error
 
1 Attachment(s)
ok im recompiling another makers plugin 2 suit my server,but wen i compile the standard .sma which they provided it errored with this before i even made any changes 2 make sure it was ok:

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

Error: Argument type mismatch (argument 2) on line 291
Error: Argument type mismatch (argument 2) on line 911
Error: Argument type mismatch (argument 2) on line 980
Error: Argument type mismatch (argument 2) on line 1036
Error: Argument type mismatch (argument 2) on line 1090

5 Errors.
Could not locate output file C:\Program Files\Valve\Steam\SteamApps\------\condition zero\czero\addons\amxmodx\scripting\compiled\ predator.amx (compile failed).

now all the other plugins compiled so its just this one which is the predator mod one, it runs on the server fine but i cant get admin access so i read that sum ppl changed the admin access required in the sma and it worked which is what im trying to do but alas i have that error everytime it compiles?? any suggestions?? heres the sma

Hawk552 04-07-2006 10:12

Please just post it in a .sma file. If it weren't so long, I would ask you to wrap it in tags.

shadowstalker 04-07-2006 10:27

sorry about that :P posted the sma

[ --<-@ ] Black Rose 04-07-2006 11:08

Code:
get_user_armor(index, &CsArmorType:armortype)
It formats armortype var to whatever armor you're using and returns armor ammount.
Instead of
Code:
cs_set_user_armor(id, cs_get_user_armor(id, CS_ARMOR_VESTHELM) - 500, CS_ARMOR_VESTHELM)
You can do like this.
Code:
                new CsArmorType:armortype                 new armorvalue = cs_get_user_armor(id, armortype)                 cs_set_user_armor(id, armorvalue - 500, CS_ARMOR_VESTHELM)
Or use the armortype var.
Code:
                new CsArmorType:armortype                 new armorvalue = cs_get_user_armor(id, armortype)                 cs_set_user_armor(id, armorvalue - 500, armortype)

This is fixed:

shadowstalker 04-07-2006 11:44

many thanks :)

JoshGomez 09-12-2007 09:12

Re: compiling error
 
How do I use armortype outside, like if(armortype == 1).
I get tag mismatch when I do like that.

purple_pixie 09-13-2007 08:34

Re: compiling error
 
"1" is not a "CsArmorType" value.
(though it is the value of one of the csarmortype values, if that makes sense ... )

It isn't actually an error (just a warning)

You should use "if ( armortype == CS_ARMOR_VESTHELM)" et c.


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

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