Jump to content
  • 0

Problema Admin


HartMon

Question

Problema intalnita (descriere):Nu am acces sa folosesc cmds /setadmin /sethelper
Ero(area / rile) / warning-(ul / urile):You dont have acces am 1338 + Rcon
Liniile de cod / sursa / script-ul(obligatoriu):if(strcmp(cmd, "/setadmin", true) == 0)

{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, " Nu esti logat inca!");
           return 1;
       }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/setadmin [playerid/PartOfName] [Level(1-6)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
new PlayerName[MAX_PLAYER_NAME];
       GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
       if(EsteManager(playerid))
   {
   if(IsPlayerConnected(para1))
   {
       if(para1 != INVALID_PLAYER_ID)
       {
           new day,month,year;
           getdate(day,month,year);
           new hour,minute,second;
           gettime(hour,minute,second);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Ai fost promovat Admin level %d de catre %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " L-ai promovat pe %s la ADMIN Level %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s l-a promovat pe %s la ADMIN Level %d.", sendername, giveplayer,level);
ABroadCast(COLOR_LIGHTBLUE, string, 1);
format(string, sizeof(string), "%s l-a promovat pe %s la ADMIN Level %d (%d-%d-%d), (%d:%d:%d)", sendername, giveplayer,level,day,month,year,hour,minute,second);
admincmdslog(string);
new query[256];
PlayerData[para1][pAdmin] = level;
format(query, sizeof(query), "UPDATE players SET AdminLevel='%d' WHERE id=%d", PlayerData[para1][pAdmin], PlayerData[para1][pSQLID]);
mysql_query(query);
}
}
}
else
{
SendError(playerid,cmd);
}
}
return 1;
}
if(strcmp(cmd, "/sethelper", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, " Nu esti logat inca!");
           return 1;
       }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/sethelper [playerid/PartOfName] [level(0/1)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
new PlayerName[MAX_PLAYER_NAME];
       GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
       if(level > 1 || level < 0) return SendClientMessage(playerid,COLOR_WHITE,"Level-ul poate fi doar 0 sau 1!");
       if(EsteManager(playerid))
   {
   if(IsPlayerConnected(para1))
   {
       if(para1 != INVALID_PLAYER_ID)
       {
           new day,month,year;
           getdate(day,month,year);
           new hour,minute,second;
           gettime(hour,minute,second);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(level == 1)
{
format(string, sizeof(string), "Ai fost promovat la Helper de catre adminul %s.", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "L-ai promovat pe %s la Helper.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s l-a promovat pe %s la Helper", sendername, giveplayer);
ABroadCast(COLOR_LIGHTBLUE, string, 1);
format(string, sizeof(string), "%s l-a promovat pe %s la Helper level %d (%d-%d-%d), (%d:%d:%d)", sendername, giveplayer,level,day,month,year,hour,minute,second);
admincmdslog(string);
}
else if(level == 0)
{
format(string, sizeof(string), "Ai fost scos din functia de Helper de adminul %s.", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "L-ai scos din functia de Helper pe %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s i-a scos Helper-ul lui %s.", sendername, giveplayer);
ABroadCast(COLOR_LIGHTBLUE, string, 1);
format(string, sizeof(string), "%s i-a scos Helper-ul lui %s(%d-%d-%d), (%d:%d:%d)", sendername, giveplayer,day,month,year,hour,minute,second);
admincmdslog(string);
}
new query[256];
PlayerData[para1][pAgent] = level;
format(query, sizeof(query), "UPDATE players SET Agent='%d' WHERE id=%d", PlayerData[para1][pAgent], PlayerData[para1][pSQLID]);
mysql_query(query);
}
}
}
else
{
SendError(playerid,cmd);
}
}
return 1;
}

Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:daaa

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

 if(EsteManager(playerid))

 

Cauta forward EsteManager(playerid);

           public EsteManager(playerid)  
 
Vei gasi o lista cu anumite Nick-uri . Ex : if((strcmp(nume, "EquiNox", true) == 0). Acolo iti pui numele si recompilezi. 
  • Upvote 1

j3V8Znq.png

5IGyOAw.png

Link to comment
Share on other sites

Guest
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.