dcmd_setadmin(playerid,params[])
{
if(AdminLvL[playerid] >= 5 || IsPlayerAdmin(playerid))
{
new giveplayerid, givelvl;
if(sscanf(params,"dz",giveplayerid,givelvl))
{
SendClientMessage(playerid,COLOR_RED,"Usage: /setadmin [id] [lvl]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
new Stringy[128];
format(Stringy, sizeof(Stringy), "ID (%d) Is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_RED, Stringy);
return 1;
}
new Stringy[128];
format(Stringy, sizeof(Stringy), "You gave ID(%d) LVL %d Admin", giveplayerid,givelvl);
SendClientMessage(playerid, COLOR_RED, Stringy);
format(Stringy, sizeof(Stringy), "You are now lvl %d Admin",givelvl);
SendClientMessage(giveplayerid, COLOR_RED, Stringy);
AdminLvL[giveplayerid] = givelvl;
return 1;
}
return 0;
}
dcmd_setadmin(playerid,params[])
{
if(AdminLvL[playerid] >= 5 || IsPlayerAdmin(playerid))
{
new giveplayerid, givelvl;
if(!sscanf(params,"ii", giveplayerid, givelvl))
{
if(!IsPlayerConnected(giveplayerid))
{
new Stringy[128];
format(Stringy, sizeof(Stringy), "ID (%d) Is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_RED, Stringy);
return 1;
}
new Stringy[128];
format(Stringy, sizeof(Stringy), "You gave ID(%d) LVL %d Admin", giveplayerid, givelvl);
SendClientMessage(playerid, COLOR_RED, Stringy);
format(Stringy, sizeof(Stringy), "You are now lvl %d Admin", givelvl);
SendClientMessage(giveplayerid, COLOR_RED, Stringy);
AdminLvL[giveplayerid] = givelvl;
return 1;
}
else SendClientMessage(playerid,COLOR_RED,"Usage: /setadmin [id] [lvl]");
}
else SendClientMessage(playerid,COLOR_RED,"You need to be admin level 5+ or RCON Admin to do that!");
}
Originally Posted by GhOstY93
thanks man this worked.... now i understand
|
Originally Posted by [B2K
Hustler ]
Quote:
|
dUserSetINT(ReturnPlayerName(playerid)).("Adminlvl",AdminLvL[playerid]);
AdminLvL[giveplayerid] = givelvl; // after this line put the next line in your command.
dUserSetINT(ReturnPlayerName(giveplayerid)).("Adminlvl",AdminLvL[giveplayerid]);
Originally Posted by [B2K
Hustler ]
There was nothing wrong with you're code, well indented as well, only the formatting i guess. Anyways, its best if you change the data in the players file immediately after as well. pawn Код:
|