CNR:Ticket command bugged
#2

pawn Код:
public PayTicketTimer(playerid)
{
    new name[24], string[40];
   
    SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+3);
    GetPlayerName(playerid, name, 24);
SendClientMessage(playerid, COLOR_RED,"Yor wanted level has been increased due to not paying tickets.");//added this
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(gTeam[i] == POL || SECSRV || ARMY || SWAT && IsPlayerConnected(i))
        {
            format(string, 40, "%s has not paid their ticket!", name);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}



CMD:ticket(playerid, params[])
{
    new string[50], string2[100], string3[50], string4[100], targetid, tReason[128], targetname[24], officername[24];
    if(sscanf(params, "us[128]", targetid, tReason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ticket [ID] [REASON]");
    {
        if(gTeam[playerid] != POL && gTeam[playerid] != SECSRV && gTeam[playerid] != ARMY && gTeam[playerid] != SWAT) return SendClientMessage(playerid, COLOR_RED, "You are not a Law Enforcement Officer!");
        if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot ticket yourself!");
        if(5.0 < GetDistanceBetweenPlayers(playerid, targetid) < 20.0)
        {
            if(isTicketed[targetid] == 0)
            {
                TIMER_PayTicket[targetid] = SetTimerEx("PayTicketTimer", 25000, false, "i", targetid); //Starting the timer for them to pay their ticket before getting their wanted level increased.
 
GameTextForPlayer(targetid, "~y~PAY YOUR ~r~TICKET", 3000, 6);//added this
                GetPlayerName(playerid, officername, 24);
                GetPlayerName(targetid, targetname, 24);

                format(string, 50, "You have received a ticket from officer %s!", officername);
                format(string2, 100, "Reason for Ticket: %s", tReason);
                format(string3, 50, "[TICKET] Officer %s has given %s a ticket.", officername, targetname);
                format(string4, 100, "Reason for ticket: %s", tReason);
               
                isTicketed[targetid] = 1;

                TicketIssuer[targetid] = playerid;
                               SendClientMessage(targetid, COLOR_ORANGE, "You have 25 seconds to pay your ticket until your wanted level increases.");//added this
                SendClientMessage(targetid, COLOR_ORANGE, string);
                SendClientMessage(targetid, COLOR_RED, string2);
               
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(gTeam[playerid] == POL || SECSRV || ARMY || SWAT)
                    {
                        SendClientMessage(playerid, COLOR_ORANGE, string3);
                        SendClientMessage(playerid, COLOR_PINK, string4);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "That player has already been ticketed!");
            }
        }
    }
    return 1;
Reply


Messages In This Thread
CNR:Ticket command bugged - by NoahF - 05.07.2014, 11:46
Re: CNR:Ticket command bugged - by BroZeus - 05.07.2014, 11:55
Re: CNR:Ticket command bugged - by NoahF - 05.07.2014, 11:59
Re: CNR:Ticket command bugged - by NoahF - 05.07.2014, 12:13
Re: CNR:Ticket command bugged - by BroZeus - 05.07.2014, 12:31
Re: CNR:Ticket command bugged - by Threshold - 05.07.2014, 13:49

Forum Jump:


Users browsing this thread: 1 Guest(s)