SA-MP Forums Archive
help me with command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help me with command (/showthread.php?tid=396141)



help me with command - Hugoca - 29.11.2012

Hi.I wanna to make command givexp.I'm using this level/exp system.Thanks


Re: help me with command - iGetty - 29.11.2012

pawn Код:
CMD:givexp(playerid, params[])
{
    new id, amount, string[128];
    if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, -1, "Usage: /givexp [playerid/name] [amount]");
    {
        PlayerInfo[id][Exp] += amount;
        format(string, sizeof(string), "XP Given: %d", amount);
        SendClientMessage(id, -1, string);
    }
    return 1;
}



Re: help me with command - Hugoca - 29.11.2012

i wanna to add it in onplayercommandtext.I wanna only admin with level 4 to use it.And i wanna to give exp to all players.And please make message "Nick give to all players ... exp"


Re: help me with command - iGetty - 29.11.2012

pawn Код:
CMD:givexp(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You must be admin to use this command.");
    new amount, string[128], name[24];
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "d", amount)) return SendClientMessage(playerid, -1, "Usage: /givexp [amount]");
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            PlayerInfo[id][Exp] += amount;
        }
        format(string, sizeof(string), "Admin %s gave %d XP to all players.", name, amount);
        SendClientMessageToAll(-1, string);
    }
    return 1;
}



Re: help me with command - Hugoca - 29.11.2012

thanks


Re: help me with command - Hugoca - 29.11.2012

please make it
pawn Код:
if(strcmp(cmd, "/givexp", true) == 0)



Re: help me with command - Mustafa6155 - 29.11.2012

First thing Hugoca i think u did on wrong section.
https://sampforum.blast.hk/showthread.php?tid=187229

becuse u asking how to make it
think it.


Re: help me with command - Hugoca - 29.11.2012

I think this isn't wrong section


Re: help me with command - Hugoca - 30.11.2012

bump ...


Re: help me with command - cessil - 30.11.2012

if you're asking for script then post in the script request thread