ROLEPLAY commands
#9

pawn Код:
command(me, playerid, params[]) {
    new
        string[128]; // Updated this as I forgot about the whole params usage at the time of originally creating this.... but seeing as how noobs constantly rip this command I might as well give them some good code to rip from! (yes I'm talking about you, RealCop228 and all the others)

    if(isnull(params)) {
        return SendClientMessage(playerid, WHITE, "SYNTAX: /me [action]");
    }
    else {
        if(Player[playerid][PrisonID] == 1) {
            SendClientMessage(playerid, WHITE, "You're unable to do this right now!");
        }
        else {
            format(string, sizeof(string), "* %s %s", GetName(playerid), params);
            NearByMessage(playerid, NICESKY, string);
           
            Player[playerid][MeActions]++;

            switch(Player[playerid][MeActions]) {
                case 100: {
                    SendClientMessage(playerid, WHITE, "You have unlocked a new achievement!");
                    SendClientMessage(playerid, GREY, "You have executed 100 /me actions.");
                    Player[playerid][AchievementRank]++;
                }
                case 200: {
                    SendClientMessage(playerid, WHITE, "You have unlocked a new achievement!");
                    SendClientMessage(playerid, GREY, "You have executed 200 /me actions.");
                    Player[playerid][AchievementRank]++;
                }
            }
        }
    return 1;
}
The only mistake I found was in /me command. Copy this, instead of what you have and it should work fine.
Reply


Messages In This Thread
ROLEPLAY commands - by davelord - 20.03.2011, 00:10
Re : ROLEPLAY commands - by anumaz - 20.03.2011, 00:19
Re: ROLEPLAY commands - by darkknight123 - 20.03.2011, 00:21
Re: ROLEPLAY commands - by murdoxix - 20.03.2011, 00:21
Re: ROLEPLAY commands - by davelord - 20.03.2011, 00:22
Re: ROLEPLAY commands - by davelord - 20.03.2011, 00:25
Re: ROLEPLAY commands - by davelord - 20.03.2011, 00:39
Re: ROLEPLAY commands - by Vince - 20.03.2011, 00:45
Re: ROLEPLAY commands - by antonio112 - 20.03.2011, 02:19
Re: ROLEPLAY commands - by davelord - 20.03.2011, 12:33

Forum Jump:


Users browsing this thread: 1 Guest(s)