[Tutorial] How to make a simple contract system (Good for RP)
#8

And honestly, you have mistakes in your script ... Let me give you an example:

Quote:
pawn Code:
CMD:contract(playerid, params[])
{
    new pID, bounty, message1[170], message2[170];
    if(sscanf(params,"ud", pID, bounty)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /contract [playerid][amount]");
    {
        GivePlayerMoney(playerid, -bounty);
        format(message1,sizeof(message1), "You've put a contract on the players head for $%d.", bounty);
        SendClientMessage(playerid, -1, message1);
        PlayerInfo[pID][pContract] = bounty;

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pFaction] == 3)
            {
                format(message2,sizeof(message2), "HQ: A player has put a contract on %s for $%d.", bounty);
                SendClientMessage(i, -1, message2);
            }
        }
    }
    return 1;
}
The mistake is at the format line:
pawn Code:
format(message2,sizeof(message2), "HQ: A player has put a contract on %s for $%d.", bounty);
Figure it out ...

How about if I do /contract X -2324324 ... That would give me 2324324$ in my hand. You need to check for negative values...

And that's just one, I noticed at a first glance over your tutorial. Overall, it's well explained but you need to be more careful.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)