(http://wiki.alliedmo...Mod_X_Scripting)
public cmd_hp(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new Arg1[24] new Arg2[4] //Get the command arguments from the console read_argv(1, Arg1, 23) read_argv(2, Arg2, 3) //Convert the health from a string to a number new Health = str_to_num(Arg2) //Is the first character the @ symbol? if (Arg1[0] == '@') { new Team = 0 //Check which team was specified. //Note that we start from [1], this is okay // it just means the @ isn't included if (equali(Arg1[1], "CT")) { Team = 2 } else if (equali(Arg1[1], "T")) { Team = 1 } //.Zdziwiło mnie to:
if (equali(Arg1[1], "CT"))
Przecież każdy element tablicy zawiera jeden znak.
to znaczy jeżeli tablica
Arg1[] = "@CT"
to:
Arg1[0] = '@'
Arg1[1] = 'C'
Arg1[2] = 'T'
To jaki cudem 1 element tablicy zawiera znak(i) "CT"?
I dlaczego jest użyto " a nie '