#6

PHP код:
CMD:pay(playeridparams[])
{
    if(
HasBeenIssuedTicket{playerid} == true)
    {
        new 
fine random(10000) + 1000;
        if(
fine GetPlayerCash(playerid))
        {
            if( 
GetPlayerMoney(playerid)  <  fine) return SendClientMessage(playeridCOLOR_RED"{ff0000}ERROR : {ffffff}You don't have enough money to pay the ticket! RUN RUN !");
            
KillTimer(TicketTimer{playerid});
            
HasBeenIssuedTicket{playerid} = false;
            
format(fstrsizeof(fstr), "[DISPATCH]: Suspect %s [%d] has payed the ticket."GetName(playerid), playerid);
            
CopRadio(BLUEfstr);
            
format(fstr2sizeof(fstr2), "Ticket paid {33FF33}$%d{FFFFFF}. Innocent civilian status achieved."fine);
            
GameTextForPlayer(playerid"~G~TICKET PAID"50005);
            
SetPlayerColor(playeridCOLOR_WHITE);
            
SendClientMessage(playeridREDfstr2);
            
format(fstr2sizeof(fstr2), "The suspect has payed the ticket, you got paid $%d."fine);
            
GameTextForPlayer(TicketIssuer[playerid], "~B~TICKET PAYED"25005);
            
SendClientMessage(TicketIssuer[playerid], YELLOWfstr2);
            
GivePlayerMoney(playerid, -fine);
            
GivePlayerMoney(TicketIssuer[playerid], fine);
            
SetPlayerWantedLevel(playerid0);
            
SetPlayerScore(TicketIssuer[playerid], GetPlayerScore(TicketIssuer[playerid]) + 1);
            
SetPlayerScore(playeridGetPlayerScore(playerid) - 1);
            
PlayerInfo[TicketIssuer[playerid]][aTickets] ++;
            
PlayerInfo[playerid][aFined] ++;
            
TicketIssuer[playerid] = -1;
        }
        else
        {
            
SendClientMessage(playeridRED"{FF0000}[ERROR]: {ffffff}You dont have engouh money to pay.");
        }
    }
    else
    {
        
SendClientMessage(playeridRED"You have not been issued a ticket.");
    }
    return 
true;

It will work I guess
Reply


Messages In This Thread
Pay! - by Thanks - 27.04.2018, 10:20
Re: Pay! - by kovac - 27.04.2018, 10:25
Re: Pay! - by Bingo - 27.04.2018, 10:28
Re: Pay! - by Thanks - 27.04.2018, 12:17
Re: Pay! - by CodeStyle175 - 27.04.2018, 12:18
Re: Pay! - by RedRex - 27.04.2018, 12:19

Forum Jump:


Users browsing this thread: 1 Guest(s)