Jump to content

Cerere tutorial creare admini


Recommended Posts

  • 2 weeks later...

Salutare.In continuare o sa iti prezint cum sa faci un sistem de admin simplu.

Mergi la

enum pInfo
sau daca ai
enum pData

Adaugi asta la OnPlayerConnect

PlayerInfo[playerid][pAdmin] = 0;

Acum iti voi da comanda /makeadmin.

if(strcmp(cmd, "/makeadmin", true) == 0)
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))//Verifica daca playerul este logat la RCON.
tmp = strtok(cmdtext, idx);
SendClientMessage(playerid, ORANGE, "Folosire: /makeadmin [playerid] [level]");
SendClientMessage(playerid, ORANGE, "Functie:Da unui player admin.");
return 1;
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][AdminLevel] = level;
printf("Admin %s >> %s admin level %d.", player, giveplayer, level);
format(string, sizeof(string), "Ai primit admin level %d de la %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "I-ai dat lui %s admin level %d.", giveplayer,PlayerInfo[giveplayerid][pAdmin]);
SendClientMessage(playerid, 0x00C2ECFF, string);
else if(giveplayerid == INVALID_PLAYER_ID)
format(string, sizeof(string), "%i nu este activ", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
SendClientMessage(playerid, 0xE60000FF, "Nu esti logat la RCON");
return 1;



Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.