16.11.2011, 19:32
pawn Код:
new giveplayer[MAX_PLAYER_NAME];
vc tem strtok no gm?
e o cmd
pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
new tmp[128];
new idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x00FF00AA, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new tmp[128];
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
format(string, sizeof(string), "Vocк foi promovido a moderador, no nнvel %d pelo administrador %s.", level, sendername);
SendClientMessage(para1, 0x008080AA, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, 0x80FF00AA, string);
}
}
}
else
{
SendClientMessage(playerid, 0x0000FFAA, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}