Problem with sending hit contract message on death
#3

Quote:
Originally Posted by Death1300
Посмотреть сообщение
Under what function did you place this code?
I placed the function under, OnPlayerDeath

And here is the bounty command,

pawn Код:
CMD:bounty(playerid, params[])
{

    if( gTeam [ playerid ] == TEAM_CIV_BOUNTY )
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} Bounty Hunters cannot place hits on other people");

    new
        id,
        amount;

    if( sscanf(params, "ui", id, amount))
        return SendUsageError( playerid, "/bounty [Name/ID] [Amount]" );

    if ( id == INVALID_PLAYER_ID )
        return InvalidPlayerError( playerid );

    if( id == playerid)
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot place a Bounty Hit on yourself");

    if( hasHit[id] == true)
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player already has a hit on them");

    if( amount <  1500)
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} Minimum hit amount is $1,500");

    if( amount >  1000000)
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} Maximum hit amount is $1,000,000");

    if( GetPlayerMoney( playerid ) < amount )
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You do not have enough money to pay for the bounty");

    hasHit[id] = true;
    hitAmount[id] = amount;

    new
        str[128],
        str1[128];

    format(str, sizeof(str), "[HIT] A $%d hit has been placed on you. Beware!", amount);
    SendClientMessage(id, RED, str);
    GameTextForPlayer(id, "~r~HIT BOUNTY ~y~PLACED~r~ON YOU", 6000, 3);

    format(str1, sizeof(str1), "[HIT] You have placed a $%d hit on %s[%d]", amount, GetName(id), id);
    SendClientMessage(playerid, RED, str1);
    GivePlayerMoney(playerid, -amount);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)