12.06.2013, 14:00
pawn Код:
if ( strcmp( cmd, "/setadmin", true ) == 0 )
{
new level, string[200];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000FF, "USE: /setadmin [id do player] [nivel]");
return 1;
}
level = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000FF, "USE: /setadmin [id do player] [nivel]");
return 1;
}
new player;
player = ReturnUser(tmp);
GetPlayerName(player, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (Admin[playerid] >= 3)
{
if(IsPlayerConnected(player))
{
Admin[player] = level;
SalvarPlayer(player);
format(string, sizeof(string),"Vocк foi Promovido a Admin Nнvel %d, por %s", level, sendername);
Mensagem(para, 0xFF0000FF, string);
format(string, sizeof(string),"Vocк promoveu %s a admin nнvel %d", giveplayer, level);
Mensagem(para, 0xFF0000FF, string);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "[ERRO:]Este Player nгo estб Conectado");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "[ERRO:] Nгo tens permissгo para fazer esse comando!");
}
return 1;
}