Unkown Command! +REP
#1

Код:
new cmd[256], idx;
	cmd = strtok(cmdtext, idx);

	if (strcmp("/answer", cmd, true) == 0)
	{
		new tmp[256], cmdid, string[256], pname[MAX_PLAYER_NAME];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid,COL_RED, "USAGE: /Answer [answer]");
		cmdid = strval(tmp);

		if(cmdid < answer || cmdid > answer)
		{
			SendClientMessage(playerid,COL_RED, "Wrong answer!");
		}

		if(cmdid == answer && answered == 0)
		{
			GetPlayerName(playerid, pname, sizeof(pname));

			format(string, sizeof(string), "%s has won %d score for answering the math question '%d'!", pname, score, cmdid);
			SendClientMessageToAll(COL_GREEN, string);
			GivePlayerMoney(playerid, 10000);

			answered = 1;
			SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
			score = 0;
			return 1;
		}
		else if(cmdid == answer && answered == 1)
		{
			SendClientMessage(playerid,COL_RED, "To late!");
		}
		return 1;
	}
	if (strcmp("/stopmaths", cmd, true) == 0)
	{
		if(IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid,COL_RED, "You are not an RCON admin");

		KillTimer(timer);
		SendClientMessage(playerid,COLOR_YELLOW, "Maths stopped");
		return 1;
	}
those commands are for the math test , when i do them in-game it shows (Unknown Command)

any ideas ?
Reply


Messages In This Thread
Unkown Command! +REP - by YoussefHammad - 16.08.2015, 17:37
Re: Unkown Command! +REP - by DarkLored - 16.08.2015, 17:39
Re: Unkown Command! +REP - by iTakelot - 16.08.2015, 17:41
Re: Unkown Command! +REP - by YoussefHammad - 16.08.2015, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)