11.02.2013, 04:38
i am making wanted lvl system but not working.
here is my stock:
ingame they showing to me "Wanted Level 0 - Arrestable" and if player have 2 star and they get a cop car so show to player 6.
PHP код:
new current_zone;
current_zone = Player_Zone[playerid];
new string[150], crimedesc;
format(string,sizeof(string),"%s (%d) has just stolen a law enforcement vehicle at %s", GetName(playerid) ,playerid, ZoneNames[current_zone][zone_name]);
CopRadio(BLUE, string);
format(string, sizeof(string), "Committed A Crime: Law Enforcement Vehicle Theft%s - Wanted Level %d - Arrestable", crimedesc, WantedLevelStars);
SendClientMessage(playerid, RED, string);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
return 1;
PHP код:
stock CommitCrime(playerid, level, crimedesc[]) {
new string[128];
PlayerInfo[playerid][Wanted] = SetPlayerWanted(playerid, PlayerInfo[playerid][Wanted] + level);
format(string, sizeof(string), "Committed a crime: %s (Wanted Level %d)", crimedesc);
SendClientMessage(playerid, WHITE, string);
}
stock SetPlayerWanted(playerid, level) {
if (level > sizeof(WantedLevelStars)) level = sizeof(WantedLevelStars);
if (level < 0) level = 0;
PlayerInfo[playerid][Wanted] = level;
SetPlayerWantedLevel(playerid, WantedLevelStars[level]);
return level;
}