05.08.2009, 08:35
i am making an admin command where u type /lotto - range of lotto numbers
here it is
if (strcmp("/lotto", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][Level] >= 3) {
if(cmdtext[6] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /lotto [ number range] Example: 1-20");
return 1;
}
new string[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "~r~%s~n~~w~I am thinking of a number within that range~n~First one to guess it gets reward~n~~y~%s", cmdtext[6], pname);
GameTextForAll(string,10000,3);
return 1;
} else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
and whenever i type /lotto [text]
it says unknown command
when i jus ttype /lotto
it says usage: /lotto [lotto number]
i dont get why it is doing that?
i made it so that the if(cmdtext[6] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /lotto [ number range] Example: 1-20");
return 1;
}
but if i have 6 or more letter it just says error:unknwon command
i dont usually ask for help, but this is just it for me, i cant freaking do this.
here it is
if (strcmp("/lotto", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][Level] >= 3) {
if(cmdtext[6] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /lotto [ number range] Example: 1-20");
return 1;
}
new string[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "~r~%s~n~~w~I am thinking of a number within that range~n~First one to guess it gets reward~n~~y~%s", cmdtext[6], pname);
GameTextForAll(string,10000,3);
return 1;
} else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
}
and whenever i type /lotto [text]
it says unknown command
when i jus ttype /lotto
it says usage: /lotto [lotto number]
i dont get why it is doing that?
i made it so that the if(cmdtext[6] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /lotto [ number range] Example: 1-20");
return 1;
}
but if i have 6 or more letter it just says error:unknwon command
i dont usually ask for help, but this is just it for me, i cant freaking do this.