a problem -
DarkLored - 22.10.2013
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);
}
}
Re: a problem -
park4bmx - 22.10.2013
Ur formatting 1 integer and then using 2 parameters for it ?
Re: a problem -
iGetty - 22.10.2013
Can you show me the "IncreaseWantedLevel" function?
Re: a problem -
DarkLored - 22.10.2013
Yes here is my increasewantedlevel function
pawn Код:
stock IncreaseWantedLevel(playerid, value)
{
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + value);
}
Re: a problem -
park4bmx - 22.10.2013
I told u why !
Re: a problem -
DarkLored - 22.10.2013
What do you mean to paramters i dont get it can you show me an exsample
Re: a problem -
park4bmx - 22.10.2013
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" ?
Re: a problem -
DarkLored - 22.10.2013
Yes i do
and the thing you did like now i did it but still same problem
Re: a problem -
park4bmx - 22.10.2013
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!
Re: a problem -
DarkLored - 22.10.2013
EDIT SOLVED THANKS REPED +