26.03.2012, 17:02
PHP код:
new PlayerText3D:pText[MAX_PLAYER];
public SetPlayerCriminal(playerid,declare,reason[])
{
if(IsPlayerConnected(playerid))
{
PlayerInfo[playerid][pCrimes] += 1;
new points = WantedPoints[playerid];
new turned[MAX_PLAYER_NAME];
new turner[MAX_PLAYER_NAME];
new turnmes[128];
new wantedmes[128];
new wlevel;
strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
if (declare == 255)
{
format(turner, sizeof(turner), "Unknown");
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
}
else
{
if(IsPlayerConnected(declare))
{
GetPlayerName(declare, turner, sizeof(turner));
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
strmid(PlayerCrime[declare][pBplayer], PlayerName[playerid], 0, strlen(turned), 255);
strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
}
}
format(turnmes, sizeof(turnmes), "{ff0500}• {ffffff}Вы совершили преступление (%s). Сообщил: %s.",reason,turner);
SendClientMessage(playerid, COLOR_LIGHTRED, turnmes);
if(points > 0)
{
new yesno;
if(points == 3) { if(WantedLevel[playerid] != 1) { WantedLevel[playerid] = 1; wlevel = 1; yesno = 1; } }
else if(points >= 4 && points <= 5) { if(WantedLevel[playerid] != 2) { WantedLevel[playerid] = 2; wlevel = 2; yesno = 1; } }
else if(points >= 6 && points <= 7) { if(WantedLevel[playerid] != 3) { WantedLevel[playerid] = 3; wlevel = 3; yesno = 1; } }
else if(points >= 8 && points <= 9) { if(WantedLevel[playerid] != 4) { WantedLevel[playerid] = 4; wlevel = 4; yesno = 1; } }
else if(points >= 10 && points <= 11) { if(WantedLevel[playerid] != 5) { WantedLevel[playerid] = 5; wlevel = 5; yesno = 1; } }
else if(points >= 12 && points <= 13) { if(WantedLevel[playerid] != 6) { WantedLevel[playerid] = 6; wlevel = 6; yesno = 1; } }
else if(points >= 14) { if(WantedLevel[playerid] != 10) { WantedLevel[playerid] = 10; wlevel = 10; yesno = 1; } }
if(yesno)
{
format(wantedmes, sizeof(wantedmes), "{ff0500}• {ffffff}Текущий уровень розыска: %d", wlevel);
SendClientMessage(playerid, COLOR_YELLOW, wantedmes);
SetPlayerWantedLevel(playerid,wlevel);
foreach (Player, i)
{
if(IsACop(i))
{
DeletePlayer3DTextLabel(i, pText[playerid]);
format(wantedmes, sizeof(wantedmes), "Преступник!\n %d звезды", wlevel);
pText[playerid] = CreatePlayer3DTextLabel(i, wantedmes, COLOR_KRAS, 0.0, 0.0, 0.35, 30.0, playerid, INVALID_VEHICLE_ID, 0);
format(cbjstore, sizeof(turnmes), "HQ: Внимание всем подразделениям: Сообщил: %s (Преступление: %s, Объект: %s)",turner,reason,PlayerName[playerid]);
SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
}
}
}
}
}
}