CMD:tk(playerid, params[])
{
if(gTeam[playerid] != TEAM_COP) return 0;
if(sscanf(params, "ui", ID)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /tk <playerid> / <PlayerName>");
if(GetPVarInt(playerid,"TkTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 5 seconds before issuing a ticket again.");
if(GetDistanceBetweenPlayers(playerid,ID) < 10)
{
new pwl = GetPlayerWantedLevel(playerid);
new opname[24];
new pname[24];
new string[120];
GetPlayerName(playerid, pname, 24);
if(pwl >= 4) return SendClientMessage(playerid, red, "This suspect has more than 4 wanted level,you can't issue a ticket to him.Use /ar instead.");
GetPlayerName(ID, opname, 24);
format(string, 120, "You have been fined by %s(%d) - You have been charged $5,000", pname, playerid);
SendClientMessage(ID, COLOR_BLUE, string);
format(string, 120, "You have fined %s (%d). You have recieved a collection prize of 1500$.", opname, ID);
SendClientMessage(playerid, COLOR_BLUE, string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i))continue;
if(gTeam[i] == TEAM_COP)
{
new copmsg[170];
format(copmsg, sizeof(copmsg), "%s (%d) has fined %s (%d).He is no longer wanted.",pname, playerid, opname, ID);
SendClientMessage(i, COLOR_BLUE, copmsg);
}
}
SetPlayerWantedLevel(ID, 0);
SetPlayerScore(playerid, 1);
GivePlayerMoney(playerid, 1500);
GivePlayerMoney(ID, -5000);
}
return 1;
}
Post the exact lines. No no one wants to fish through that un-indented code.
|
{
if(gTeam[playerid] != TEAM_COP) return 0;
GivePlayerMoney(ID, -5000);
}
CMD:tk(playerid, params[])
{
if(gTeam[playerid] != TEAM_COP) return 0;
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /tk <playerid> / <PlayerName>");
if(GetPlayerWantedLevel(ID) >= 4) return SendClientMessage(playerid, red, "This suspect has more than 4 wanted level,you can't issue a ticket to him.Use /ar instead.");
if(GetPVarInt(playerid, "TkTime") > gettime()) return SendClientMessage(playerid, 0xFF0000FF, "Please wait 5 seconds before issuing a ticket again.");
if(GetDistanceBetweenPlayers(playerid, ID) > 10.0) return 0;
new opname[24], pname[24], string[144];
GetPlayerName(playerid, pname, 24);
GetPlayerName(ID, opname, 24);
format(string, sizeof(string), "You have been fined by %s (%d) - You have been charged $5,000", pname, playerid);
SendClientMessage(ID, COLOR_BLUE, string);
format(string, sizeof(string), "You have fined %s (%d). You have recieved a collection prize of $1500.", opname, ID);
SendClientMessage(playerid, COLOR_BLUE, string);
for(new i = 0; i != MAX_PLAYERS; ++i)
{
if(!IsPlayerConnected(i))continue;
if(gTeam[i] == TEAM_COP)
{
format(string, sizeof(string), "%s (%d) has fined %s (%d). He is no longer wanted.", pname, playerid, opname, ID);
SendClientMessage(i, COLOR_BLUE, string);
}
}
SetPlayerWantedLevel(ID, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
GivePlayerMoney(playerid, 1500);
GivePlayerMoney(ID, -5000);
SetPVarInt(playerid, "TkTime", gettime() + 5); //5 = 5 seconds
return 1;
}
I'll say it again. Indent your code! It doesn't really matter WHY it is poorely indented, the point is it is. And that does not look like indented code ported to the forums as there are certain patterns that aren't showing up there.
|
[pawn] [/pawn]
You copy all the code straight from Pawno.
Go to the post, type PHP код:
|