31.10.2009, 21:36
What am i doing wrong here? (im a begginer please help me understand this)
I am using DUDB.
pawn Код:
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;
}