if(strcmp(cmd, "/daradmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [ID/ParteDoNick] [level(1-1340)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] == 5000) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: %s promoveu %s para Admin Level %d .", sendername, giveplayer, level); format(string, sizeof(string), " Vocк foi promovido a Admin Level %d por %s", level, sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), " Vocк promoveu %s para Admin Level %d .", giveplayer,level); SendClientMessage(playerid, COLOR_WHITE, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " vocк nгo estб autorizado a usar esse comando !"); } } return 1; }
#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;
}
#tryinclude sscanf2
#tryinclude zcmd
COMMAND \
:tiraradmin (playerid, params[])
{
new
_1PARAM;
if(unformat(params, "u", _1PARAM)) SendClientMessage(playerid, (0xDFD50BFF), "- \"/tiraradmin <playerid/nickname>\"");
else if(_1PARAM == INVALID_PLAYER_ID) SendClientMessage(playerid, (0xDFD50BFF), "- PLAYER_NOT_FOUND !");
else if(PlayerInfo[playerid][pAdmin] == 5000) {
PlayerInfo[_1PARAM][pAdmin] = 0;
}
else return false;
return true;
}
if(strcmp(cmd, "/tiraradm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /tiraradm [ID/ParteDoNick]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] == 5000)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = 0;
printf("AdmCmd: %s removeu o level de admin de %s.", sendername, giveplayer);
format(string, sizeof(string), " Seu level de admin foi removido por %s", sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " Vocк removeu o level de admin de %s.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " vocк nгo estб autorizado a usar esse comando !");
}
}
return 1;
}
Originally Posted by @PlayMaker
pawn Код:
|