SA-MP Forums Archive
I have tried all i can - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I have tried all i can (/showthread.php?tid=89937)



I have tried all i can - anonymoushacker - 05.08.2009

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.