a problem
#1

Hello samp members
i made some changes from the code i got by a samp member
that is a string and when i get wanted level 4
it types [WANTED LEVEL INCREASED]You have stolen a police vehicle your wanted level has increased to:0
it types 0 when it needs to type 4

Here is my code:
pawn Код:
if (GetVehicleModel(GetPlayerVehicleID(playerid)) >= 596 && GetVehicleModel(GetPlayerVehicleID(playerid)) <= 599)
   {
       if(gTeam[playerid] != Team_Cop)
       {
          new string[120];
          SendClientMessage(playerid,COLOR_YELLOW,"You have stolen a police vehicle the police is after you...");
          format(string,sizeof(string),"[WANTED LEVEL INCREASED]You have stolen a police vehicle your wanted level has increased to:%i",GetPlayerWantedLevel(playerid),playerid);
          SendClientMessage(playerid,COLOR_ORANGE,string);
          format(string,sizeof(string),"{435FFA}%s(%d) Has stolen a LSPD Vehicle his wanted now go arrest him!", GetName(playerid),playerid);
          SendClientMessageToAllCops(string);
          IncreaseWantedLevel(playerid, 4);
       }
   }
Reply
#2

Ur formatting 1 integer and then using 2 parameters for it ?
Reply
#3

Can you show me the "IncreaseWantedLevel" function?
Reply
#4

Yes here is my increasewantedlevel function
pawn Код:
stock IncreaseWantedLevel(playerid, value)
{
   SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + value);
}
Reply
#5

I told u why !
Reply
#6

What do you mean to paramters i dont get it can you show me an exsample
Reply
#7

pawn Код:
format(string,sizeof(string),"[WANTED LEVEL INCREASED]You have stolen a police vehicle your wanted level has increased to:%d",GetPlayerWantedLevel(playerid));
U test as I'd "0" ?
Reply
#8

Yes i do
and the thing you did like now i did it but still same problem
Reply
#9

Do this above it
pawn Код:
printf("level: %d",GetPlayerWantedLevel(playerid));
EDIT
Stop all this I just notice ur mistake
pawn Код:
if (GetVehicleModel(GetPlayerVehicleID(playerid)) >= 596 && GetVehicleModel(GetPlayerVehicleID(playerid)) <= 599)
   {
       if(gTeam[playerid] != Team_Cop)
       {
          new string[120];
          IncreaseWantedLevel(playerid, 4);
          SendClientMessage(playerid,COLOR_YELLOW,"You have stolen a police vehicle the police is after you...");
          format(string,sizeof(string),"[WANTED LEVEL INCREASED]You have stolen a police vehicle your wanted level has increased to:%i",GetPlayerWantedLevel(playerid),playerid);
          SendClientMessage(playerid,COLOR_ORANGE,string);
          format(string,sizeof(string),"{435FFA}%s(%d) Has stolen a LSPD Vehicle his wanted now go arrest him!", GetName(playerid),playerid);
          SendClientMessageToAllCops(string);
       }
   }
You are setting the level after it's being read!
Reply
#10

EDIT SOLVED THANKS REPED +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)