Need help with an offline command
#1

Hi there. So yeah i need help with this command so it would be like /osetxp so it sets a players xp even if he's offline i have 2 commands that maybe would help on the way to it.

Код:
CMD:oban(playerid,params[])
{
    new string[124], string1[124];
    if(!(pInfo[playerid][pAdminLevel] >= 2)) return SCM(playerid, COLOR_LIGHTBLUE,"You are not authorized to use this command");
    format(string,sizeof(string),"/ZMA/Users/%s.ini",params);
    if(isnull(params)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /oban [Player Name]");
    if(!fexist(string)) return SendClientMessage(playerid,-1,"This user account is not found in our database. Please re-check the username.");
    {
        new INI:File = INI_Open(string);
        // PlayerInfo[playerid][pBan] = 1; // I don't know why you have this?
        format(string1, sizeof(string1), "%s {FFFFFF}has been Offline Banned by %s.", params,PlayerName(playerid));
        SendClientMessageToAll(COLOR_RED,string1);
        INI_SetTag(File,"data");
        INI_WriteInt(File,"pBanned", 1);
        INI_Close(File);
    }
    return 1;
}

CMD:setxp(playerid,params[])
{
    if(pInfo[playerid][pLogged] == 1)
    {
		if(pInfo[playerid][pAdminLevel] >= 7)
		{
		    new targetid,givexp,string[256];
			if(sscanf(params, "ui", targetid, givexp)) return SendClientMessage(playerid,-1,""chat" /setxp [playerid] [amount]");
		    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");

			pInfo[targetid][pXP] = givexp;

			format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s has set %s xp to %d",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),givexp);
			SendClientMessageToAll(-1,string);
		}
		else {
			SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
Reply
#2

Pretty much copy your oban command but instead of setting pBanned set the XP..
Reply
#3

Quote:
Originally Posted by Isolated
Посмотреть сообщение
Pretty much copy your oban command but instead of setting pBanned set the XP..
But that way I'm forced to insert a specific amount of it, i need a command that i would be able to set to any amount of xp, i hope im clear to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)