#5

Since you didn't tell me how your system works and what exactly you want in command.

I made it very simple.
If you have any question please ask, I'll be glad to help you.

This is the command ( uses ZCMD and sscanf ) :

pawn Код:
COMMAND:confession(playerid, params[])
{
    // Here should go your system like if(playerinfo[playerid][isapriest] == 1)
    new id,ammount;
    if(!sscanf(params,"ud", id, ammount))
    {
        if(IsPlayerConnected(id))
        {
            if(ammount >= 1000 || ammount <= 99000)
            {
                new string[128], name[MAX_PLAYER_NAME], Pname[MAX_PLAYER_NAME];
                new Pwanted = GetPlayerWantedLevel(id);
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, Pname, sizeof(Pname));
                SetPlayerWantedLevel(id, Pwanted - 5);
                format(string, sizeof(string), " %s has confessted you his sins.",Pname);
                SendClientMessage(playerid, 0xFFFF00FF, string);
                format(string, sizeof(string), "Priest %s has heard your sins and you soccessfully made a confession.",name);
                SendClientMessage(id, 0xFFFF00FF, string);
                GivePlayerMoney(id, -ammount);
            }
            else return SendClientMessage(playerid, 0xFF0000FF, "Please use ammount between 1000 and 99000");

        }
        else return SendClientMessage(playerid, 0xFF0000FF, "This player is not online.");
    }
    else return SendClientMessage(playerid, 0xFFFF00FF,"Usage: /confession [PlayerID] [Ammount]");
    return 1;
}
Reply


Messages In This Thread
Help - by DnL - 09.01.2011, 12:18
Re: Help - by Alex_Valde - 09.01.2011, 12:21
Re: Help - by DnL - 09.01.2011, 12:22
Re: Help - by DnL - 09.01.2011, 12:35
Re: Help - by Alex_Valde - 09.01.2011, 13:09

Forum Jump:


Users browsing this thread: 2 Guest(s)