22.08.2011, 19:25
Hello, until now I was working with strcmp and decided to go on zcmd, I created my first command but I'm gettin' an error and a warning.
(213) : warning 213: tag mismatch on this line:
(228 ) : error 001: expected token: ";", but found "}" on this line:
If anyone can help me, please.
pawn Code:
CMD:makeadmin(playerid, params[])
{
new pID, value;
if(!PlayerInfo[playerid][pAdmin] == 1338) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You are not the OWNER!");
else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /makeadmin [playerid/partofname] [level 1-1338]");
else if (pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(pID, tName, MAX_PLAYER_NAME);
format(string, sizeof(string), "You have promoted %s to Admin level %i", tName, value);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "You have been promoted to Admin level %i by %s", value, pName);
SendClientMessage(pID, -1, string);
PlayerInfo[pID][pAdmin] = value;
}
return 1
}
pawn Code:
if(!PlayerInfo[playerid][pAdmin] == 1338) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You are not the OWNER!");
pawn Code:
}