Jump to content

Help, va rog.


Google..r
 Share

Recommended Posts

Poti gasi aceasta comanda in gm-ul skim, dar o sa ti-o las eu aici.

Dar daca vrei sa o faci chiar tu poti urmarii comanda /makeadmin schimband unele variabile.

CMD:vreauadmin(playerid, params[])
{
 
if(IsPlayerConnected(playerid))
{
new id,adminlevel,sendername[30],giveplayer[30],string[200],escape[200];
if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFFFF}Syntax: {FFFFFF}/vreauadmin` <Name/Playerid> <Admin Level>");
if(IsPlayerConnected(id))
{
      if(id != INVALID_PLAYER_ID)
      {
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("Admin: %s i-a dat %s admin, level %d .", sendername, giveplayer, adminlevel);
format(string, sizeof(string), "Ai primit admin %d, level: %s.", adminlevel, sendername);
SendClientMessage(id, COLOR_YELLOW, string);
format(string, sizeof(string), "Ai dat admin %s, level %d.", giveplayer,adminlevel);
SendClientMessage(playerid, COLOR_YELLOW, string);
mysql_real_escape_string(string, escape);
PlayerInfo[id][pAdmin] = adminlevel;
if(adminlevel == 0)
{
AdminDuty[id] = 0;
}
new str[256];
mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Admin`='%d' WHERE `name`='%s'",PlayerInfo[id][pAdmin],PlayerInfo[id][pNormalName]);
mysql_tquery(SQL,str,"","");
mysql_format(SQL,str, sizeof(str), "INSERT INTO staff_logs (`text`) VALUES ('%s')", escape);
mysql_tquery(SQL,str,"","");
  }
}
  }
return 1;
}
Edited by StroKe.SR
Link to comment
Share on other sites

Foloseste urmatoare verificare la comanda /makeadmin:

new playerName[MAX_PLAYER_NAME];
new Name = GetPlayerName(playerid, playerName, sizeof(playerName));
if(PlayerInfo[playerid][pAdmin] < 6 || !strcmp(Name, "Numele_Tau", true)) return SendClientMessage(playerid, -1, "Nu ai acces");

Link to comment
Share on other sites

 

Foloseste urmatoare verificare la comanda /makeadmin:

new playerName[MAX_PLAYER_NAME];
new Name = GetPlayerName(playerid, playerName, sizeof(playerName));
if(PlayerInfo[playerid][pAdmin] < 6 || !strcmp(Name, "Numele_Tau", true)) return SendClientMessage(playerid, -1, "Nu ai acces");

Gresit. Tu folosesti o variabila de tip string intr-o variabila de tip integer.

 

Asa e corect:

new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
if(PlayerInfo[playerid][pAdmin] < 6 || !strcmp(playerName, "Numele_Tau", true)) return SendClientMessage(playerid, -1, "Nu ai acces");
Edited by Alliance Zooky.
Link to comment
Share on other sites

 

Gresit. Tu folosesti o variabila de tip string intr-o variabila de tip integer.

 

Asa e corect:

new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
if(PlayerInfo[playerid][pAdmin] < 6 || !strcmp(playerName, "Numele_Tau", true)) return SendClientMessage(playerid, -1, "Nu ai acces");

ups... se mai intampla dupa 3 luni de pauza :) mersi ca m-ai corectat

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.