13.05.2011, 07:35
Heey guys
I made a ticket and payticket command:
But how can i let it make if the suspect pays his ticket that the cop who gave the ticket gets money.
Thanks admigo
I made a ticket and payticket command:
Код:
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; }
Thanks admigo