05.07.2014, 11:46
Hi guys
My ticket command is bugged.
When I die it says "You have 25 seconds to pay your ticket until your wanted level increases."
There is a timer so that after 25 seconds your wanted level increases.
Here is the public for the timer:
Here is the ticket command:
Here is the Pay Ticket command:
It also says that when I am in the server when I GMX it.
Here's where the KillTimers are located:
PayTicket
OnPlayerDeath
OnPlayerConnect
OnPlayerDisconnect
Thank you for the help.
My ticket command is bugged.
When I die it says "You have 25 seconds to pay your ticket until your wanted level increases."
There is a timer so that after 25 seconds your wanted level increases.
Here is the public for the timer:
Код:
public PayTicketTimer(playerid)
{
new name[24], string[40];
SendClientMessage(playerid, COLOR_ORANGE, "You have 25 seconds to pay your ticket until your wanted level increases.");
GameTextForPlayer(playerid, "~y~PAY YOUR ~r~TICKET", 3000, 6);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+3);
GetPlayerName(playerid, name, 24);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == POL && SECSRV && ARMY && SWAT)
{
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.
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, 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;
}
Код:
CMD:payticket(playerid, params[])
{
new string[60], PayerName[24];
if(isTicketed[playerid] == 1)
{
if(GetPlayerMoney(playerid) >= 1000)
{
GivePlayerMoney(playerid, -1000);
isTicketed[playerid] = 0;
SendClientMessage(playerid, COLOR_GREEN, "You have paid your ticket. Your wanted level is now restored back to 0.");
SetPlayerWantedLevel(playerid, 0);
GivePlayerMoney(TicketIssuer[playerid], 2000);
TicketPaid[playerid] = 1;
SendClientMessage(playerid, COLOR_BLUE, "You receive a ticket collection bonus of $2000! Good work!");
KillTimer(TIMER_PayTicket[playerid]);
TicketIssuer[playerid] = -1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == POL || SECSRV || ARMY || SWAT)
{
GetPlayerName(playerid, PayerName, 24);
format(string, 60, "%s has paid their ticket.", PayerName);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have not been given a ticket!");
}
return 1;
}
Here's where the KillTimers are located:
PayTicket
OnPlayerDeath
OnPlayerConnect
OnPlayerDisconnect
Thank you for the help.

