29.07.2010, 21:32
This is my command to give someone admin level but the problem is that when napishsam / setadmin 0 0 Level or any other in the end / 0 1 setadmin to pushing smoll Level can admin! and do not change my files DINI
pawn Код:
CMD:setadmin(playerid, params[])
{
if(PlayerInfo[playerid][LoggedIn] != 1)
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Мора да се најавите за можете да ја користите оваа команда.");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid, COLOR_RED, "Morate da se ulogirate za da bi mogli koristiti ovu komandu.");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid, COLOR_RED, "You must login to use this command.");
}
}
if(PlayerInfo[playerid][Level] >= 4)
{
new tmp[256], tmp2[256], Index;
tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params))
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [админ ниво]");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [admin level]");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [admin level]");
}
return 1;
}
new kohde, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
kohde = strval(tmp);
if(!strlen(tmp2))
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [админ ниво]");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [admin level]");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid, COLOR_RED, "/setadmin [ID] [admin level]");
}
return 1;
}
level = strval(tmp2);
if(!IsPlayerConnected(kohde))
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid,COLOR_RED,"Неточен ID.");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid,COLOR_RED,"Krivi ID.");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid,COLOR_RED,"Wrong ID.");
}
return 1;
}
if(PlayerInfo[kohde][LoggedIn] != 1)
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid,COLOR_RED,"Играчот мора да биде најаван за да му дадете Админ ниво.");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid,COLOR_RED,"Igrac mora biti ulogiran da biste mu dali admin level.");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid,COLOR_RED,"Player must be logged in to submit admin level.");
}
return 1;
}
if(level == PlayerInfo[kohde][Level])
{
if(IgracInfo[playerid][Jezik] == 1)
{
SendClientMessage(playerid,COLOR_RED,"Играчот веќе е тоа Админ ниво.");
}
if(IgracInfo[playerid][Jezik] == 2)
{
SendClientMessage(playerid,COLOR_RED,"Igrac je vec taj Admin level.");
}
if(IgracInfo[playerid][Jezik] == 3)
{
SendClientMessage(playerid,COLOR_RED,"The player is already admin Level.");
}
return 1;
}
GetPlayerName(kohde, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new string[128];
if(level > 0)
{
if(IgracInfo[kohde][Jezik] == 1)
{
format(string,sizeof(string),"Администратор %s го намести твоето админ ниво на: %d",adminname, level);
}
if(IgracInfo[kohde][Jezik] == 2)
{
format(string,sizeof(string),"Admin %s je namjestio tvoj admin level na: %d",adminname, level);
}
if(IgracInfo[kohde][Jezik] == 3)
{
format(string,sizeof(string),"Administrator %s has set your admin level on: %d",adminname, level);
}
return 1;
}
SendClientMessage(kohde,COLOR_LIGHTGREEN,string);
new file[256];
format(file,sizeof(file),"Korisnici/%s.ini", PlayerName(playerid));
dini_IntSet(file,"Level",level);
PlayerInfo[kohde][Level] = level;
PlayerPlaySound(kohde,1057,0.0,0.0,0.0);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
return 1;
}