[ajuda] /daradmin sem ser na rcon
#1

quero que pra esse comando funcionar eu n esteja logado na rcon tem como ?

Quote:

if(strcmp(cmd, "/daradmin", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5000 || 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, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}

Reply
#2

retira
pawn Код:
if (IsPlayerAdmin(playerid))
{
Reply
#3

pawn Код:
stock Nome(playerid)
{
    new nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nome, sizeof(nome));
    return nome;
}
pawn Код:
f(strcmp(cmd, "/daradmin", true) == 0)
{
if(strfind(Nome(playerid),"SERRA93",true) != -1) // Mude para o seu nick in-game.
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
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("|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, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo й o Serrinha43 <3!");
}
}
return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)