30.09.2012, 11:21
Salut , am o comanda pe server /makeadmin insa am o problema . Aceasta fiind daca ii dau cuiva admin 1 , el poate sa-si dea /makeadmin Nume 1338 ... ?! Care este problema :
Astept raspuns
Multumesc anticipat.
Code:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /makeadmin [playerid/PartOfName] [level(1-1338)]");
return 1;
}
/*if(AdminSecurity[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Pentru securitate, indetifica-te in /account panel!");
return 1;
}*/
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] <= 1339)
{
if(IsPlayerConnected(para1))
{
if(IsPlayerAdmin(para1))
{
SendClientMessage(playerid, COLOR_GRAD2, "Adminul acesta este logat ca admin principal !");
return 1;
}
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("SERVER: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nu ai dreptul de a utiliza aceasta comanda!");
}
}
return 1;
}
Multumesc anticipat.



) , ne-a zis si profu de info despre operatori
... am editat acum