20.11.2012, 14:43
PHP код:
if(newkeys == KEY_FIRE)
{
new rand = random(GetPlayerMoney(playerid)),Float:x,Float:y,Float:z,string[100];
while(rand > GetPlayerMoney(playerid))
if(gTeam[playerid] != TEAM_POLICE) return SendClientMessage(playerid,red,"ERROR: "lgrey"You aren't a police man!");
if(hastickettopay[playerid] == 0) return SendClientMessage(playerid,red,"You dont have a ticket to pay!");
if(GetPlayerWantedLevel(playerid) > 2) return SendClientMessage(playerid,red,""lgrey"You cant pay your ticket! You have a high wanted level"lyellow2"(/arrest)");
format(string,sizeof(string),""lred"You aren't near "lyellow2"%s",GetPName(Ticketid[playerid]));
GetPlayerPos(Ticketid[playerid],x,y,z);
if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)) return SendClientMessage(playerid,red,string);
GivePlayerMoney(Ticketid[playerid],rand);
GivePlayerMoney(playerid,-rand);
KillTimer(Ticket[playerid]);
hastickettopay[playerid] = 0;
SendFMessage(playerid,red,"",GetPName(Ticketid[playerid]),rand);
SendFMessage(Ticketid[playerid],red,"%s has paid $%i for his ticket",GetPName(playerid),rand);
return 1;
}