28.05.2010, 20:00
Utiliza ZCMD + SSCANF, й muito melhor. ;')
Exprimenta. ;')
pawn Код:
#tryinclude sscanf2
#tryinclude zcmd
COMMAND \
:daradmin (playerid, params[])
{
new
_1PARAM,
_2PARAM,
_1NAME[MAX_PLAYER_NAME],
_2NAME[MAX_PLAYER_NAME],
MY_STRING[512 char];
if(unformat(params, "uu", _1PARAM, _2PARAM)) SendClientMessage(playerid, (0xDFD50BFF), "- \"/daradmin <playerid/nickname> <level(1-1340)>\"");
else if(_1PARAM == INVALID_PLAYER_ID) SendClientMessage(playerid, (0xDFD50BFF), "- PLAYER_NOT_FOUND !");
else if(PlayerInfo[playerid][pAdmin] == 5000)
{
GetPlayerName(playerid, _1NAME, sizeof _1NAME);
GetPlayerName(_1PARAM, _2NAME, sizeof _2NAME);
PlayerInfo[_1PARAM][pAdmin] = _2PARAM;
printf(
"AdmCmd: %s promoveu %s para Admin Level %d ."
, _1NAME
, _2NAME
, _2PARAM
);
format(MY_STRING, sizeof(MY_STRING)
, " Vocк foi promovido a Admin Level %d por %s"
, _2PARAM
, _1NAME
);
SendClientMessage(_1PARAM, (0xDFD50BFF), MY_STRING);
format(MY_STRING, sizeof(MY_STRING)
, " Vocк promoveu %s para Admin Level %d ."
, _2NAME
, _2PARAM
);
SendClientMessage(playerid, (0xDFD50BFF), MY_STRING);
}
else return false;
return true;
}