10.02.2015, 16:08
Hello,
Please Tell me how can i make like if one player have wanted level 9 or lower or higher if wantedlevel increase more than 10 it should set to 10. not more than 10!
??
??
Please Tell me how can i make like if one player have wanted level 9 or lower or higher if wantedlevel increase more than 10 it should set to 10. not more than 10!
??
??
pawn Код:
stock SetPlayerWantedStats(playerid,Crime[])
{
new string[256];
PlayerInfo[playerid][pWantedLevelTime] = 120;
PlayerInfo[playerid][pCrimesCommitted] ++;
PlayerCrimeListRowNo[playerid] ++;
if (PlayerCrimeListRowNo[playerid] < MAX_CRIMES)
{
new row = PlayerCrimeListRowNo[playerid];
strmid(PlayerCrimeList[playerid][row], Crime, 0, 256, 256);
}
else
{
PlayerCrimeListRowNo[playerid] = 1;
strmid(PlayerCrimeList[playerid][1], Crime, 0, 256, 256);
strmid(PlayerCrimeList[playerid][2], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][3], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][4], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][5], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][6], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][7], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][8], " ", 0, 256, 256);
strmid(PlayerCrimeList[playerid][9], " ", 0, 256, 256);
}
switch (PlayerInfo[playerid][pWantedLevel])
{
case -1:{SetPlayerColor(playerid, COLOR_TEAM_LAW);SetPlayerWantedLevel(playerid, 0);}
case 0:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_0);SetPlayerWantedLevel(playerid, 0);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Innocent Civilian",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_0, string);}
case 1:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_1);SetPlayerWantedLevel(playerid, 1);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_1, string);}
case 2:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_2);SetPlayerWantedLevel(playerid, 2);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_2, string);}
case 3:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_3);SetPlayerWantedLevel(playerid, 2);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_3, string);}
case 4:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_4);SetPlayerWantedLevel(playerid, 3);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_4, string);}
case 5:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_5);SetPlayerWantedLevel(playerid, 3);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_5, string);}
case 6:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_6);SetPlayerWantedLevel(playerid, 4);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_6, string);}
case 7:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_7);SetPlayerWantedLevel(playerid, 4);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_7, string);}
case 8:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_8);SetPlayerWantedLevel(playerid, 5);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_8, string);}
case 9:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_9);SetPlayerWantedLevel(playerid, 5);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_9, string);}
case 10:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_10);SetPlayerWantedLevel(playerid, 6);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued - Most Wanted",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_10, string);}
case 11:{SetPlayerColor(playerid, COLOR_WANTED_LEVEL_10);PlayerInfo[playerid][pWantedLevel] = 10;SetPlayerWantedLevel(playerid, 6);format(string, sizeof(string), "Committed A Crime (%s) - Wanted Level %d - Felon - Warrant Issued - Most Wanted",Crime,PlayerInfo[playerid][pWantedLevel]);SendClientMessage(playerid, COLOR_WANTED_LEVEL_10, string);}
}
if (IsSuspectInRangeOfPolice(playerid))
{
Police_Responding_Id = playerid;
Police_Responding_Time = 40;
Police_Responding_To_Crime = 2;
strmid(Police_Responding_Text, Crime, 0, 128, 128);
}
}