05.04.2010, 08:47
ok, so I have made a little code for a /name command. when you type 1 it shows your name and when you type 0 it hides ur name (/name 1/0)
the problem is that when I type just /name ot /name 123213 or anything else it hids my name when it should say "Correct algorithm /team 1/0". It shows it just when I type /name 2 or /name 3 etc. Can you help?
Код:
dcmd_name(playerid,params[]) { #pragma unused params new a; sscanf(params, "i", a); if(a == 1) { ShowPlayerNameTagForPlayer(MAX_PLAYERS, playerid, 1); SendClientMessage(playerid, COLOUR_YELLOW,"Your name has been unhidden!"); } else if(a == 0) { ShowPlayerNameTagForPlayer(MAX_PLAYERS, playerid, 0); SendClientMessage(playerid, COLOUR_YELLOW,"Your name has been hidden!"); } else SendClientMessage(playerid, COLOUR_RED,"Correct algorithm: /name 1/0"); return 1; }
