Posts: 108
Threads: 21
Joined: Aug 2016
Quote:
Originally Posted by Mencent
Hello.
Write it like this. When you have questions or some other Problems where you Need help then feel free to ask.
PHP код:
new lastVehicle[MAX_PLAYERS];//under includes
//your callback:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid == Car[TEAM_COP] && gTeam[playerid] == TEAM_CIV && VehicleEntry[playerid] == 0)
{
if(lastVehicle[playerid] != vehicleid)
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 10);
VehicleEntry[playerid] = 1;
lastVehicle[playerid] = vehicleid;
}
}
}
return 1;
}
|
Doesn't work,let me explain a bit more, i've 3 vehicles (Cop Cheetah,Cop Cheetah,Cop Infernus) all 3 are cop cars if a team civ enter Vehicle 1 (1 of the cop cheetahs) he'll get 10 wanted stars if he exits then reenter that same car he wont get anystars has he was already there,but if he goes into the 2nd cop cheetah or infernus his wanted start would be 20 now.
Edit:
i've my cars defined as
Код:
Car[TEAM_COPS] = AddStaticVehicle(...);
should i change it to.
Код:
Car[TEAM_COPS][0] = AddStaticVehicle(...);
Overall. could that be the problem or provided code?