setlevel command help please
#1

hello guys please help me im realy need help so i make some admin command and here is one



Код:
dcmd_mmode(playerid, params[])
{
    new givePlayer, str[128], PlayerFile[100], pName[24];
    if(Player[playerid][admin] < 2){
	return SendClientMessage(playerid, COLOR_RED, "You Dont Have Right To Use This Command");
	}
    new id;
    if(sscanf(params, "u", id))
	{
	    SendClientMessage(playerid, COLOR_RED, "USAGE: /mmode [playerid]");
	    return 1;
	}
    else if (id == INVALID_PLAYER_ID)
	{
	    SendClientMessage(playerid, COLOR_RED, "Player not found");
	    return 1;
	}
    else
    {
    	Player[playerid][admin] = 1;
       	SendClientMessage(givePlayer, COLOR_GREEN, "An administrator has given you mode rights.");
		format(str, sizeof(str), "You have give %s(%d) mode rights.", pName, playerid);
		SendClientMessage(playerid, COLOR_GREEN, str);
  		format(PlayerFile, sizeof(PlayerFile), "maxadmin/users/%s.ini", pName);
		dini_IntSet(PlayerFile, "Level", 1);
    }
    return 1;
}
now when i do this command on my self its all work but when i got checkout file scriptfile/maxadmin/users/Max.inc i see no change
Reply
#2

bumpp.
Reply
#3

Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
hello guys please help me im realy need help so i make some admin command and here is one



Код:
dcmd_mmode(playerid, params[])
{
    new givePlayer, str[128], PlayerFile[100], pName[24];
    if(Player[playerid][admin] < 2){
	return SendClientMessage(playerid, COLOR_RED, "You Dont Have Right To Use This Command");
	}
    new id;
    if(sscanf(params, "u", id))
	{
	    SendClientMessage(playerid, COLOR_RED, "USAGE: /mmode [playerid]");
	    return 1;
	}
    else if (id == INVALID_PLAYER_ID)
	{
	    SendClientMessage(playerid, COLOR_RED, "Player not found");
	    return 1;
	}
    else
    {
    	Player[playerid][admin] = 1;
       	SendClientMessage(givePlayer, COLOR_GREEN, "An administrator has given you mode rights.");
		format(str, sizeof(str), "You have give %s(%d) mode rights.", pName, playerid);
		SendClientMessage(playerid, COLOR_GREEN, str);
  		format(PlayerFile, sizeof(PlayerFile), "maxadmin/users/%s.ini", pName);
		dini_IntSet(PlayerFile, "Level", 1);
    }
    return 1;
}
now when i do this command on my self its all work but when i got checkout file scriptfile/maxadmin/users/Max.inc i see no change
Change this:
Код:
Player[playerid][admin] = 1;
Into this:
Код:
Player[giveplayer][admin] = 1;
Reply
#4

Quote:
Originally Posted by Ihsan-Cingisiz
Посмотреть сообщение
Change this:
Код:
Player[playerid][admin] = 1;
Into this:
Код:
Player[givePlayer][admin] = 1;
Because otherwise it will set your own Alevel.

(I'm not a real sscanf user but i know this is the problem, because of the Dini :P)
Reply
#5

Duh, haven't you forgotten the level parament? Obviously you see no changes, since it's 1, and will be set for 1. And 1 == 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)