14.07.2010, 18:36
pawn Код:
CMD:ticket(playerid, params[])
{
new giveplayerid;
if (sscanf(params, "u", giveplayerid)) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Usage: /Ticket [ID]");
else if (!IsPlayerConnected(giveplayerid)) SendClientMessage(playerid, 0xFF0000FF, "[INFO] Invalid ID");
else if (GetPlayerWantedLevel(giveplayerid) == 0) SendClientMessage(playerid, 0xFF0000FF, "[INFO] That Player Is Not A Suspected Player");
else if (TicketTo[playerid]!=999) SendClientMessage(playerid, 0xFF0000FF, "[INFO] That Player Already Has A Ticket.");
else if (TicketFrom[giveplayerid] != 999) SendClientMessage(playerid, 0xFF0000FF, "[INFO] That Player Already Has A Ticket");
else
if (GetPlayerWantedLevel(giveplayerid) >= 1)
{
TicketTo[playerid] = giveplayerid;
TicketFrom[giveplayerid] = playerid;
new bname[128];
new tmp[128];
GetPlayerName(playerid, bname, sizeof(bname));
format(tmp,128,"[INFO] Officer %s Has Ticketed you",bname);
SendClientMessage(giveplayerid, COLOR_YELLOW, tmp);
SendClientMessage(giveplayerid, COLOR_YELLOW, "[INFO] Do /pay To Pay The Ticket!");
SendClientMessage(playerid, COLOR_GREEN, "[INFO] Player Ticketed");
}
else if (GetPlayerWantedLevel(giveplayerid) > 3)
{
SendClientMessage(playerid, 0xFF0000AA, "Error: %s(%d) Does Not Have A Warrant Please Use /tk [playerid]");
return 1;
}
return 1;
}
CMD:pay(playerid, params[])
{
if(gTeam[playerid] == TEAM_COPS)
{
if(Ticket[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[INFO] You Don't Have A Ticket.");
}
else
{
new bname[128];
GetPlayerName(playerid, bname, sizeof(bname));
new string[128];
new randmoney = random(2300);
GivePlayerMoney(playerid,randmoney);
GivePlayerMoney(TicketFrom[playerid], -randmoney);
format(string, sizeof(string), "Officer %s Has Ticketed You %s Cash Type /pay To Pay The Ticket", bname,randmoney);
SendClientMessage(playerid, WHITE, string);
SetPlayerWantedLevel(TicketFrom[playerid], 0);
TicketTo[TicketFrom[playerid]] = 999;
Ticket[playerid] = 0;
TicketFrom[playerid] = 999;
}
}
return 1;
}