11.02.2011, 19:27
So I figured somehow out this code:
Now I know where the problem itself SHOULD be:
What should i replace params with? Using zcmd and sscanf. By the way if I do /makeadmin it keeps telling me the form how to do it.
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "[USAGE:] /makeadmin [playerid] [adminlevel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(params, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdminLevel] >= 5 || IsPlayerAdmin(playerid))
{
if(para1 != INVALID_PLAYER_ID)
{
PlayerInfo[para1][pAdminLevel] = level;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new string[128];
format(string, sizeof(string), "[INFO:] %s has just made you administrator level: %d.", name,level);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), "[INFO:] You have made %s an administrator - Level: %d.", name,level);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[ERROR:] Your not an administrator/correct level.");
}
return 1;
}
pawn Код:
tmp = strtok(params, idx);