----------------------------------------Comanda-----------------------------------------//
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerData[playerid][pAdmin] >= 0)
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "{ffffff}Ne pare rau, dar nu esti logat pentru a utiliza aceata comanda!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/makeadmin [playerid/PartOfName]");
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 );
HackLog(string);
new query[128];
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);
}
}
}
}
}
return 1;
|