[POMOC]Wanted level

Započeo m-a-r-k-o, Jul 24, 2011, 01:40:03 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Mod koji koristim:Raven's

Opis problema: Recimo kad sam u nekoj bandi i ubije pd onda dobijem wanted level a kad ubije nekog iz bande onda ne.

Dio skripte:


if(victimteam >= 4)
{
   if(IsPlayerConnected(killerid))
   {
//new killer[MAX_PLAYER_NAME];
//GetPlayerName(killerid, killer, sizeof(killer));
new slice = 100; //$100
playercash = GetPlayerMoney(playerid);
if(gTeam[killerid] != 2) { WantedPoints[killerid] += 2; } //+ 2 wanted points
if(SafeTime[playerid] <= 0)
{
if(gTeam[killerid] != gTeam[playerid])
{
if(GetPlayerState(killerid) == 1)
{
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 2;
}
else
{
PlayerInfo[killerid][pKills]++;
}
PlayerInfo[playerid][pKills]--;
}
}
/*if (strlen(deathreason) > 0)// patch
{
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || gTeam[killerid] == gTeam[playerid])//med kill criminal
{
format(string, sizeof(string), ".: %s murdered %s. (%s) :.", killer, name, deathreason);
}
else
{
format(string, sizeof(string), ".: %s murdered %s. (%s) for $%d :.", killer, name, deathreason, slice);
}

}
else
{
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill || gTeam[killerid] == gTeam[playerid]))
{
format(string, sizeof(string), ".: %s murdered %s :.", killer, name);
}
else
{
format(string, sizeof(string), ".: %s murdered %s for $%d :.", killer, name, slice);
}
}*/
if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
{
slice = 0;
}
if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
{
slice = 0;
}
if (playercash > 0)
{
SafeGivePlayerMoney(playerid, -slice);
}
else
{
slice = slice+500;
}
//SafeGivePlayerMoney(killerid, slice);
//GameTextForPlayer(playerid, dmessage, 5000, 2);
PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
if (((gTeam[killerid]) == 3) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo prvog stupnja");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo i bijeg");
}
}
}
else if (victimteam == 2)
{
   if(IsPlayerConnected(killerid))
   {
//new killer[MAX_PLAYER_NAME];
//GetPlayerName(killerid, killer, sizeof(killer));
// Cop kill
PlayerInfo[playerid][pKills]--;
if (gTeam[killerid] == 2)//cops kill cop
{
//format(string,128,".: Officer %s murdered Officer %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
SafeGivePlayerMoney(killerid, -suecost);
SafeGivePlayerMoney(playerid, suecost+100);//+100pays hospital bill
}
else
{
//format(string,128,".: %s murdered Officer %s (%s) :.",killer,name,deathreason);
   }
if (gTeam[killerid] >= 3)
{
   WantedPoints[killerid] += 2; //+ 2 wanted points
if(reason != 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo prvog stupnja");
}
else if (reason == 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo i bijeg");
}
}
if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
{
if(GetPlayerState(killerid) == 1)
{
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
}
else
{
PlayerInfo[killerid][pKills]++;
}
WantedPoints[killerid]+=2;
}
//BroadCast(COLOR_RED, string);
}
}
else if (victimteam == 3)
{
   if(IsPlayerConnected(killerid))
   {
//new killer[MAX_PLAYER_NAME];
//GetPlayerName(killerid, killer, sizeof(killer));
// Civ kill
if ((gTeam[killerid]) == 2)//cops kill civ
{
   if(WantedLevel[playerid] < 1)
   {
//format(string,128,".: Officer %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
SafeGivePlayerMoney(killerid, -suecost);
SafeGivePlayerMoney(playerid, suecost+10);//+100pays hospital bill
}
}
else
{
//format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
WantedPoints[killerid] += 2;
   }
if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo prvog stupnja");
}
else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo i bijeg");
}
   //BroadCast(COLOR_RED, string);
}
}
else if (victimteam == 1)
{
   if(IsPlayerConnected(killerid))
   {
//new killer[MAX_PLAYER_NAME];
//GetPlayerName(killerid, killer, sizeof(killer));
// Civ kill
if ((gTeam[killerid]) == 2)//cops kill civ
{
//format(string,128,".: Officer %s murdered Paramedic %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
SafeGivePlayerMoney(killerid, -suecost);
SafeGivePlayerMoney(playerid, suecost+10);//+100pays hospital bill
}
else if ((gTeam[killerid]) == 1)//med kill civ
{
//format(string,128,".: Paramedic %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
SafeGivePlayerMoney(killerid, -suecost);
SafeGivePlayerMoney(playerid, suecost+10);//+100pays hospital bill
}
else
{
//format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
   }
if (((gTeam[killerid]) == 4) && reason != 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo prvog stupnja");
}
else if (((gTeam[killerid]) == 3) && reason == 49)
{
SetPlayerCriminal(killerid,255, "Ubojstvo i bijeg");
}
   //BroadCast(COLOR_RED, string);
}
}



public SetPlayerCriminalEx(playerid,declare,reason[])
{//example: SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
if(IsPlayerConnected(playerid))
{
    new points = WantedPoints[playerid];
new turned[MAX_PLAYER_NAME];
new turner[MAX_PLAYER_NAME];
new turnmes[128];
new wantedmes[128];
new wlevel;
new string[128];
strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
GetPlayerName(playerid, turned, sizeof(turned));
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], turned, 0, strlen(turned), 255);
strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
}
}
if(PlayerInfo[playerid][pAdminDuty] == 1 || PlayerInfo[playerid][pTesterDuty] == 1)
{
format(string, sizeof(string),"Vas zlocin je %s, Prijavio: %s, Ali vi ste Admin/Tester na dužnosti. Zlocin se ne broji",reason,turner);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
return 1;
}
strmid(PlayerInfo[playerid][pCrimeReason], reason, 0, strlen(reason), 255);
PlayerInfo[playerid][pWanted] = 1;
PlayerInfo[playerid][pWantedLevel] = points;
  PlayerInfo[playerid][pCrimes] += 1;
    SetPlayerColor(playerid, 0xBBBBBB00);
format(turnmes, sizeof(turnmes), "Pocinili ste zlocin: %s. Prijavio: %s.",reason,turner);
        PlayCrimeReportForPlayer(playerid,playerid,5);
SendClientMessage(playerid, COLOR_DARKNICERED, 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(WantedLevel[playerid] >= 1) { if(gTeam[playerid] == 3) { gTeam[playerid] = 4; } }
if(yesno)
{
format(wantedmes, sizeof(wantedmes), "Trenutni Wanted Level: %d", wlevel);
SendClientMessage(playerid, COLOR_YELLOW, wantedmes);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(IsACop(i))
    {
format(cbjstore, sizeof(turnmes), "HQ: Sve jedinice APB: Prijavio: %s",turner);
SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
format(cbjstore, sizeof(turnmes), "HQ: Zlocin: %s, Osumnjiceni: %s",reason,turned);
SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
PlayCrimeReportForPlayer(i,playerid,5);
}
}
}
}
}
}//not connected
return 1;
}
Poslednja Izmena: Jul 24, 2011, 02:42:38 PRE PODNE od m-a-r-k-o