Commands Problem
#8

pawn Код:
CMD:hit(playerid, params[])
{
    new amount,stringx[128],tname[MAX_PLAYER_NAME];
    if(sscanf(params, "ud", ID, amount)) return SendClientMessage(playerid, RED, "[USAGE]: /hit [name/id] [amount]");
    if(amount < 10000) return SendClientMessage(playerid, COLOR_AQUA, "The hit must be atleast worth $10,000.");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, RED, "Player not found.");
    if(ID == playerid) return SendClientMessage(playerid, COLOR_AQUA, "You cannot place a hit on yourself.");
    if(GetPlayerCash(playerid) < amount) return SendClientMessage(playerid, RED, "Insufficient funds.");
    if(HasHit[ID] > 0) return SendClientMessage(playerid, COLOR_AQUA, "That player already has a hit contract placed on them.");
    {
        HasHit[ID] = amount;
        HasPlacedHit[ID] = playerid;
        GetPlayerName(ID,tname,MAX_PLAYER_NAME);
        format(fstr, sizeof(fstr), "You have placed a hit on %s [%d] for $%d.", GetName(ID), ID, amount);
        SendClientMessage(playerid, COLOR_AQUA, fstr);
        format(stringx,sizeof(stringx),"HIT PLACED ON %s FOR $%d",tname,amount);
        GameTextForPlayer(playerid,stringx, 5000, 5);
        format(stringx,sizeof(stringx),"Hit placed on you by: %s",GetName(playerid));
        GameTextForPlayer(ID,stringx, 5000, 5);
        format(fstr2, sizeof(fstr2), "[HIT]: %s [%d] has placed a hit contract on %s [%d] for $%d.", GetName(playerid), playerid, GetName(ID), ID, amount);
        SendClientMessageToAll(COLOR_AQUA, fstr2);
        SendClientMessage(ID, COLOR_AQUA, "You now have a hit contract!");
    }
    return true;
}
Reply


Messages In This Thread
Commands Problem - by sscarface - 15.01.2013, 19:07
Re: Commands Problem - by Infinity90 - 15.01.2013, 19:11
Re: Commands Problem - by Konstantinos - 15.01.2013, 19:12
Re: Commands Problem - by sscarface - 15.01.2013, 19:36
Re: Commands Problem - by sscarface - 15.01.2013, 20:38
Re: Commands Problem - by RajatPawar - 16.01.2013, 07:38
Re: Commands Problem - by sscarface - 16.01.2013, 10:16
Re: Commands Problem - by Threshold - 16.01.2013, 12:43

Forum Jump:


Users browsing this thread: 5 Guest(s)