dcmd_payticket(playerid,params[]) { #pragma unused params new string[128]; if(IsSpawned[playerid] != 1) { SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command."); return 1; } if(IsKidnapped[playerid] == 1) { SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command."); return 1; } if(HasTicket[playerid] != 1) { SendClientMessage(playerid,COLOR_RED,"You do not have a ticket to pay."); return 1; } SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Ticket Paid_]]"); SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have paid your ticket of $2000 and your wanted level has been removed."); SetPlayerWantedLevel(playerid,0); GivePlayerMoney(playerid,-2000); HasTicket[playerid] =0; TimeToPayTicket[playerid] =0; format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has paid their ticket of $2000 and their wanted level has been removed.",PlayerName(playerid),playerid); SendClientMessageToAllCops(string); return 1; }
dcmd_ticket(playerid,params[]) { new string[128]; new ID; if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_RED,"USAGE: /ticket (Player Name/ID)"); return 1; } if(IsKidnapped[playerid] == 1) { SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command."); return 1; } if(IsSpawned[playerid] != 1) { SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command."); return 1; } if(gTeam[playerid] != TEAM_COP) { SendClientMessage(playerid,COLOR_RED,"Only law enforcement can issue tickets to suspects."); return 1; } if(InAdminMode[ID] == 1) { SendClientMessage(playerid,COLOR_RED,"You cannot use this command on this player because they are in Administrator mode."); return 1; } if(!IsPlayerConnected(ID)) { format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot issue them a ticket.",ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(GetPlayerWantedLevel(ID) >= 2) { SendClientMessage(playerid,COLOR_RED,"You cannot give this player a ticket! You need to arrest him!"); return 1; } if(GetDistanceBetweenPlayers(playerid,ID) > 8) { format(string,sizeof(string),"%s(%d) is too far away. You cannot issue them a ticket. Get closer.",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(HasTicket[ID] ==1) { SendClientMessage(ID,COLOR_RED,"Pay Your ticket!"); return 1; } SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Fined_]]"); format(string,sizeof(string),"Law Enforcement Officer %s(%d) has issued you a ticket of $2000 for your criminal actions.",PlayerName(playerid),playerid); SendClientMessage(ID,COLOR_DODGERBLUE,string); SendClientMessage(ID,COLOR_DODGERBLUE,"You have 2 minutes to pay this ticket with /payticket or your wanted level will increase."); HasTicket[ID] =1; TimeToPayTicket[ID] =120; TextDrawSetString(MessageTD[ID],"TICKET RECIEVED"); TextDrawShowForPlayer(ID,MessageTD[ID]); MessageTDTime[ID] =5; IncreasePlayerScore(playerid,1); format(string,sizeof(string),"[POLICE RADIO] Law Enforcement Officer %s(%d) has issued a ticket of $2000 to %s(%d).",PlayerName(playerid),playerid,PlayerName(ID),ID); SendClientMessageToAllCops(string); return 1; }
dcmd_payticket(playerid,params[])
{
#pragma unused params
new string[128];
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command.");
return 1;
}
if(HasTicket[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"You do not have a ticket to pay.");
return 1;
}
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Ticket Paid_]]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have paid your ticket of $2000 and your wanted level has been removed.");
SetPlayerWantedLevel(playerid,0);
GivePlayerMoney(playerid,-2000);
if(IsPlayerConnected(GetPVarInt(playerid, "copTicket")) && GetPVarType(playerid, "copTicket") != 0) {
GivePlayerMoney(GetPVarInt(playerid, "copTicket"), 2000);
DeletePVar(playerid, "copTicket");
}
HasTicket[playerid] =0;
TimeToPayTicket[playerid] =0;
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has paid their ticket of $2000 and their wanted level has been removed.",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);
return 1;
}
dcmd_ticket(playerid,params[])
{
new string[128];
new ID;
if(sscanf(params, "u", ID))
{
SendClientMessage(playerid,COLOR_RED,"USAGE: /ticket (Player Name/ID)");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You are kidnapped. You cannot use this command.");
return 1;
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(gTeam[playerid] != TEAM_COP)
{
SendClientMessage(playerid,COLOR_RED,"Only law enforcement can issue tickets to suspects.");
return 1;
}
if(InAdminMode[ID] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You cannot use this command on this player because they are in Administrator mode.");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot issue them a ticket.",ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(GetPlayerWantedLevel(ID) >= 2)
{
SendClientMessage(playerid,COLOR_RED,"You cannot give this player a ticket! You need to arrest him!");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) > 8)
{
format(string,sizeof(string),"%s(%d) is too far away. You cannot issue them a ticket. Get closer.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(HasTicket[ID] ==1)
{
SendClientMessage(ID,COLOR_RED,"Pay Your ticket!");
return 1;
}
SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Fined_]]");
format(string,sizeof(string),"Law Enforcement Officer %s(%d) has issued you a ticket of $2000 for your criminal actions.",PlayerName(playerid),playerid);
SendClientMessage(ID,COLOR_DODGERBLUE,string);
SendClientMessage(ID,COLOR_DODGERBLUE,"You have 2 minutes to pay this ticket with /payticket or your wanted level will increase.");
HasTicket[ID] =1;
TimeToPayTicket[ID] =120;
TextDrawSetString(MessageTD[ID],"TICKET RECIEVED");
TextDrawShowForPlayer(ID,MessageTD[ID]);
MessageTDTime[ID] =5;
SetPVarInt(ID, "copTicket", playerid);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"[POLICE RADIO] Law Enforcement Officer %s(%d) has issued a ticket of $2000 to %s(%d).",PlayerName(playerid),playerid,PlayerName(ID),ID);
SendClientMessageToAllCops(string);
return 1;
}
This should work:
pawn Код:
|
SetPVarInt(playerid, "Test", 2);
if(GetPVarInt(playerid, "Test") == 2)