22.03.2016, 06:15
hi guys how can i do when some1 get wanted only cops can see his name with red , after some1 from cops kills him his nick name will get back to his color from civil or faction tutorial
//OnPlayerDeath:
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID && IsPlayerCop(killerid) && GetPlayerWantedLevel(playerid) > 0)
{
SetPlayerWantedLevel(playerid,0);
for(new i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(IsPlayerCop(i))
{
SetPlayerMarkerForPlayer(i,playerid,-1);//White color
}
}
}
return 1;
}
//When the player will get the wanteds:
for(new i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(IsPlayerCop(i))
{
SetPlayerMarkerForPlayer(i,playerid,0xFF0019FF);//Red color
}
}
function SetPlayerCriminal(playerid,turner,reason[],wanted) { AddCrime(playerid, reason, wanted); if(turner == 999) { format(gString, sizeof(gString), "You've commited a crime: %s. Reporter: Unknown.",reason); SendClientMessage(playerid, COLOR_LIGHTRED2, gString); format(gString, sizeof(gString), "HQ: All Units APB: Reporter: Unknown"); SendFactionMessage(1, COLOR_RADIO, gString); SendFactionMessage(2, COLOR_RADIO, gString); format(gString, sizeof(gString), "HQ: Crime: %s, Suspect: %s",reason,GetName(playerid)); SendFactionMessage(1, COLOR_RADIO, gString); SendFactionMessage(2, COLOR_RADIO, gString); } else { format(gString, sizeof(gString), "You've commited a crime: %s. Reporter: %s.",reason,GetName(turner)); SendClientMessage(playerid, COLOR_DARKNICERED, gString); format(gString, sizeof(gString), "HQ: All Units APB: Reporter: %s",GetName(turner)); SendFactionMessage(1, COLOR_RADIO, gString); SendFactionMessage(2, COLOR_RADIO, gString); format(gString, sizeof(gString), "HQ: Crime: %s, Suspect: %s",reason,GetName(playerid)); SendFactionMessage(1, COLOR_RADIO, gString); SendFactionMessage(2, COLOR_RADIO, gString); if(IsACop(playerid)) { SetPlayerMarkerForPlayer(playerid, playerid, 0xFF0019FF);//Red color } } if(PlayerInfo[playerid][pWanted] + wanted < 6) { PlayerInfo[playerid][pWanted] += wanted; Update(playerid, pWantedx); } else { PlayerInfo[playerid][pWanted] = 6; Update(playerid, pWantedx); } foreach(new i : Player) { if(!IsPlayerConnected(i))continue; if(IsACop(i)) { SetPlayerMarkerForPlayer(i,playerid,0xFF0019FF);//White color } } PlayerInfo[playerid][pWantedLost] = 1800; Update(playerid, pWantedLostx); TextDrawShowForPlayer(playerid, WantedTime[playerid]); PlayerInfo[playerid][pCrimes] ++; Update(playerid, pCrimesx); SetPlayerWantedLevel(playerid,PlayerInfo[playerid][pWanted]); if(PlayerInfo[playerid][pWanted] == 6) GiveAchievement(playerid, 13, "Be the most wanted", 100); }
if(IsACop(killerid) && OnDuty[killerid] == 1 && PlayerInfo[playerid][pWanted] >= 1) { new price = PlayerInfo[playerid][pWanted] * 3000, Float: x, Float: y, Float: z; // iFordawin GetPlayerPos(playerid, x, y, z); format(gString, sizeof(gString), "~w~Running Suspect~r~Killed~n~Bonus~g~$%s", FormatNumber(price)); foreach(new i : Player) //iFordawin { if(!IsACop(i) || !IsPlayerInRangeOfPoint(i, 15.0, x, y, z) || !OnDuty[i]) continue; GivePlayerCash(i, price); GameTextForPlayer(i, gString, 5000, 1); PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0); } //iFordawin format(gString, sizeof (gString), "HQ: Running suspect %s (wanted level %d) was killed by %s %s.", GetName(playerid), PlayerInfo[playerid][pWanted], GetName(killerid), (PlayerInfo[killerid][pLeader] + PlayerInfo[killerid][pMember]) == 1 ? ("Officer") : ("Sergeant")); SendFactionMessage(1, COLOR_RADIO, gString); SendFactionMessage(2, COLOR_RADIO, gString); GivePlayerCash(playerid, - price); PlayerInfo[playerid][pJailed] = 1; Update(playerid, pJailedx); PlayerInfo[playerid][pJailTime] = (PlayerInfo[playerid][pWanted])*(300); Update(playerid,pJailTimex); format(gString, sizeof(gString), "You are in Jail for %d Seconds and lose $%s because of running away and getting shot by the Officer.", PlayerInfo[playerid][pJailTime], FormatNumber(price)); SendClientMessage(playerid, COLOR_LIGHTRED, gString); PlayerInfo[playerid][pWanted] = 0; Update(playerid,pWantedx); SetPlayerWantedLevel(playerid,0); PlayerInfo[playerid][pWantedDeaths] ++; Update(playerid, pWantedDeathsx); ClearCrimes(playerid); GiveAchievement(playerid, 16, "Get busted", 100); TextDrawHideForPlayer(playerid, WantedTime[playerid]); foreach(new i : Player) { if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue; if(IsACop(i)) { SetPlayerMarkerForPlayer(i,playerid,-1);//White color } } if(CP[playerid] == 999) { foreach(new i : Player) { if(RobbingWith[i] == playerid) RobbingWith[i] = -1; } CP[playerid] = 0; DisablePlayerRaceCheckpoint(playerid); } }
function SetPlayerCriminal(playerid,turner,reason[],wanted)
{
AddCrime(playerid, reason, wanted);
if(turner == 999)
{
format(gString, sizeof(gString), "You've commited a crime: %s. Reporter: Unknown.",reason);
SendClientMessage(playerid, COLOR_LIGHTRED2, gString);
format(gString, sizeof(gString), "HQ: All Units APB: Reporter: Unknown");
SendFactionMessage(1, COLOR_RADIO, gString);
SendFactionMessage(2, COLOR_RADIO, gString);
format(gString, sizeof(gString), "HQ: Crime: %s, Suspect: %s",reason,GetName(playerid));
SendFactionMessage(1, COLOR_RADIO, gString);
SendFactionMessage(2, COLOR_RADIO, gString);
}
else
{
format(gString, sizeof(gString), "You've commited a crime: %s. Reporter: %s.",reason,GetName(turner));
SendClientMessage(playerid, COLOR_DARKNICERED, gString);
format(gString, sizeof(gString), "HQ: All Units APB: Reporter: %s",GetName(turner));
SendFactionMessage(1, COLOR_RADIO, gString);
SendFactionMessage(2, COLOR_RADIO, gString);
format(gString, sizeof(gString), "HQ: Crime: %s, Suspect: %s",reason,GetName(playerid));
SendFactionMessage(1, COLOR_RADIO, gString);
SendFactionMessage(2, COLOR_RADIO, gString);
foreach(new i : Player)
{
if(!IsPlayerConnected(i))continue;
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, playerid, 0xFF0019FF);//Red color
}
}
}
if(PlayerInfo[playerid][pWanted] + wanted < 6)
{
PlayerInfo[playerid][pWanted] += wanted;
Update(playerid, pWantedx);
}
else
{
PlayerInfo[playerid][pWanted] = 6;
Update(playerid, pWantedx);
}
PlayerInfo[playerid][pWantedLost] = 1800;
Update(playerid, pWantedLostx);
TextDrawShowForPlayer(playerid, WantedTime[playerid]);
PlayerInfo[playerid][pCrimes] ++;
Update(playerid, pCrimesx);
SetPlayerWantedLevel(playerid,PlayerInfo[playerid][pWanted]);
if(PlayerInfo[playerid][pWanted] == 6) GiveAchievement(playerid, 13, "Be the most wanted", 100);
}