Try this for ya! I wrote this on my iPad, so it COULD be missing something, but I'd doubt it! You'll need the ZCMD and sscanf2 includes, along with the latest version of foreach. You will also need the IsNumeric function if you don't already have it (in that case, search for it).
pawn Code:
new
pMapperLevel[MAX_PLAYERS] = 0
;
CMD:makemapper(playerid, params[])
{
new iID, iLevel;
// add your IsPlayerAdmin < 4 here
if(sscanf(params, "ud", iID, iLevel))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /makemapper [nick/id] [reason]");
if(iLevel < 1 || iLevel > 4)
return SendClientMessage(playerid, COLOR_RED, "Invalid level specified. Valid level's are 1 through 4.");
new szString[128];
format(szString, sizeof(szString), "%s has set your mapper level to %d.", getName(playerid), iLevel);
SendClientMessage(iID, COLOR_GREEN, szString);
format(szString, sizeof(szString), "You have set %s's mapper level to %d.", getName(iID), iLevel);
SendClientMessage(playerid, COLOR_RED, szString);
pMapperLevel[iID] = iLevel;
return 1;
}
stock getName(playerid)
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}
CMD:mc(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /mc [message]");
if(pMapperLevel[playerid] < 1)
return 1;
new szString[128];
format(szString, sizeof(szString), "Mappers Chat - %s: %s", getName(playerid), params);
foreach(new i : Player)
{
if(pMapperLevel[i] > 0)
{
SendClientMessage(i, COLOR_BLUE, szString);
}
}
return 1;
}
CMD:createobject(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /createobject [object id]");
if(!IsNumeric(params))
return SendClientMessage(playerid, COLOR_RED, "ERROR: Object ID's must be numerical!");
new Float:fPos[3];
GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
new object = CreateObject(strval(params), fPos[0], fPos[1], fPos[2], -1, -1, -1);
EditObject(playerid, object);
return 1;
}