Raised This Month: $ Target: $400
 0% 

equali and wiki


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marticus
Member
Join Date: Nov 2004
Old 02-18-2006 , 17:20   equali and wiki
Reply With Quote #1

In the following wiki item http://wiki.amxmodx.org/index.php/In...od_X_Scripting

Code:
if (equali(Arg1[1], "CT"))

It is my understanding that we are testing the equality of Arg1[1] which would be "C", assuming Arg1 is "@CT", and "CT", which doesn't seem like it should pass, because "C" and "CT" are not equal. How and why does this work?
Marticus is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-18-2006 , 18:39  
Reply With Quote #2

Code:
new arg[] = "@GABEN" if(arg[0] == '@') {     // What arg[1] mean is just start at the index 1 instead of including arg[0] which is @     if(equali(arg[1], "GABEN"))         server_print("OMG YOU DID SOMETHING TO GABEN") }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
BAILOPAN
Join Date: Jan 2004
Old 02-18-2006 , 18:46  
Reply With Quote #3

Pawn doesn't work like you think it does. equali() takes an array. If it took a character, var[i] would be passed in. but instead, pawn automatically just returns the &var[i] -- chopping the array at that point and passing it in.
__________________
egg
BAILOPAN is offline
Marticus
Member
Join Date: Nov 2004
Old 02-18-2006 , 19:43  
Reply With Quote #4

Thanks
Marticus 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 18:31.


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