wanted level problem
#1

i am making wanted lvl system but not working.

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) ,playeridZoneNames[current_zone][zone_name]);
                    
CopRadio(BLUEstring);
                    
format(stringsizeof(string), "Committed A Crime: Law Enforcement Vehicle Theft%s - Wanted Level %d  - Arrestable"crimedescWantedLevelStars);
                    
SendClientMessage(playeridREDstring);
                    
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 4);
                    return 
1
here is my stock:

PHP код:
stock CommitCrime(playeridlevelcrimedesc[]) {
    new 
string[128];
    
PlayerInfo[playerid][Wanted] = SetPlayerWanted(playeridPlayerInfo[playerid][Wanted] + level);
    
format(stringsizeof(string), "Committed a crime: %s (Wanted Level %d)"crimedesc);
    
SendClientMessage(playeridWHITEstring);
}
stock SetPlayerWanted(playeridlevel) {
    if (
level sizeof(WantedLevelStars)) level sizeof(WantedLevelStars);
    if (
level 0level 0;
    
PlayerInfo[playerid][Wanted] = level;
    
SetPlayerWantedLevel(playeridWantedLevelStars[level]);
    return 
level;

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.
Reply
#2

someone help me? before i start fucking bump?
Reply
#3

Sorry but I can't understand anything from what you're saying ... Try explaining better if you want to be helped. And don't 'threaten' people, that'll get you nowhere.

'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.'

What's this?
Reply
#4

well, leave it now i will explain you again. when i enter the vehicle ingame so they show to me like this "Wanted Level 0 - Arrestable" and what i want? i want like this >> "Wanted Level 4 - Arrestable"
Reply
#5

pawn Код:
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;
Look at your code, your level is set After you send the message, so its still 0 when you send the message.

use
pawn Код:
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);
                    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
                    format(string, sizeof(string), "Committed A Crime: Law Enforcement Vehicle Theft%s - Wanted Level %d  - Arrestable", crimedesc, WantedLevelStars);
                    SendClientMessage(playerid, RED, string);
                   
                    return 1;
Reply
#6

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
pawn Код:
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;
Look at your code, your level is set After you send the message, so its still 0 when you send the message.

use
pawn Код:
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);
                    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
                    format(string, sizeof(string), "Committed A Crime: Law Enforcement Vehicle Theft%s - Wanted Level %d  - Arrestable", crimedesc, WantedLevelStars);
                    SendClientMessage(playerid, RED, string);
                   
                    return 1;
did and same error still showing 0
Reply
#7

https://sampwiki.blast.hk/wiki/Debugging

After you have read that page change your code to find the bug. Then post your new code (and print log) here IF you haven't fixed it yourself.
Reply
#8

Quote:
Originally Posted by pelani
Посмотреть сообщение
did and same error still showing 0
Then, there is something wrong. Did you compile and restart the server, and tested it after that ?
Reply
#9

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
Then, there is something wrong. Did you compile and restart the server, and tested it after that ?
yes i compiled and restart and join and test but still showing to me 0.
Reply
#10

bump?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)