Need help with /payticket
#2

You could just do /pay so when players get ticket Officer says to pay
pawn Код:
command(pay, playerid, params[])
{
    new id, plmoney, string[128];
    if(sscanf(params, "ud", id, plmoney))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /pay [playerid] [amount]");
    }
    else
    {
        if(Player[playerid][Money] >= plmoney)
        {
            if(IsPlayerConnectedEx(id) || id != playerid)
            {
                if(Spectator[id][SpecSpectatingPlayer] != -1)
                {
                    SendClientMessage(playerid, WHITE, "You're too far away.");
                }
                else
                {
                    if(plmoney > 0 && plmoney < 20000)
                    {
                        if(GetDistanceBetweenPlayers(playerid, id) < 5)
                        {
                            Player[playerid][Money] -= plmoney;
                            Player[id][Money] += plmoney;
                            format(string, sizeof(string), "You have paid $%s to %s.", IntToFormattedStr(plmoney), GetName(id));
                            SendClientMessage(playerid, WHITE, string);
                            format(string, sizeof(string), "* %s has paid %s some money ($%s).", GetName(playerid), GetName(id), IntToFormattedStr(plmoney));
                            NearByMessage(id, NICESKY, string);
                            new tmpip1[128], tmpip2[128];
                            GetPlayerIp(playerid, tmpip1, sizeof(tmpip1));
                            GetPlayerIp(id, tmpip2, sizeof(tmpip2));
                            new hour, minute, second, day, year, month;
                            gettime(hour, minute, second);
                            getdate(year, month, day);
                            format(string, sizeof(string), "[PAY] %s (IP: %s) has paid %s (IP: %s) $%s on %d/%d/%d (%d:%d:%d)", GetName(playerid), tmpip1, GetName(id), tmpip2, IntToFormattedStr(plmoney), day, month, year, hour, minute, second);
                            MoneyLog(string);
                            format(string, sizeof(string), "You have been paid $%s, by %s.", IntToFormattedStr(plmoney), GetName(playerid));
                            SendClientMessage(id, WHITE, string);
                           
                            if(Player[playerid][PlayingHours] == 0 && plmoney >= 999 && Player[playerid][AdminLevel] < 1)
                            {
                                format(string, sizeof(string), "WARNING: %s may possibly be money-farming, they've given $%s to %s (w/ 0 playing hours)", GetName(playerid), IntToFormattedStr(plmoney), GetName(id));
                                SendToAdmins(ADMINORANGE, string, 0);
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, WHITE, "You're too far away.");
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, WHITE, "You can't pay under $1, or over $19,999.");
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, WHITE, "Player not connected or not logged in, or is you.");
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Need help with /payticket - by Admigo - 10.05.2011, 13:00
Re: Need help with /payticket - by dannyk0ed - 10.05.2011, 14:42

Forum Jump:


Users browsing this thread: 3 Guest(s)