SA-MP Forums Archive
Increase wanted level if in LVPD car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Increase wanted level if in LVPD car (/showthread.php?tid=451653)



Increase wanted level if in LVPD car - _Khaled_ - 18.07.2013

I tried me and a friend to solve it, but it didn't work out
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new string[256];
    new zone[MAX_ZONE_NAME];
    new pname[MAX_PLAYER_NAME];
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        TextDrawShowForPlayer(playerid, Speed1[playerid]);
        TextDrawShowForPlayer(playerid, Speed2[playerid]);
        TextDrawShowForPlayer(playerid, Speed3[playerid]);
        TextDrawShowForPlayer(playerid, Speed4[playerid]);
        TextDrawShowForPlayer(playerid, Speed5[playerid]);
    }
    if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        TextDrawHideForPlayer(playerid, Speed1[playerid]);
        TextDrawHideForPlayer(playerid, Speed2[playerid]);
        TextDrawHideForPlayer(playerid, Speed3[playerid]);
        TextDrawHideForPlayer(playerid, Speed4[playerid]);
        TextDrawHideForPlayer(playerid, Speed5[playerid]);
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        //Law Enforcement Vehicles +4 stars
        if(GetPlayerVehicleID(playerid) == 598 || GetPlayerVehicleID(playerid)== 523 || GetPlayerVehicleID(playerid) == 490)
        {
      //   if(gTeam[playerid] == TEAM_CIVIL)  THIS AND THE BELOW ONE, BOTH DON'T WORK
           if(gTeam[playerid] != TEAM_COPS && gTeam[playerid] != TEAM_CIA && gTeam[playerid] != TEAM_SWAT && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_MEDIC)
           {
             GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
             SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
             SetPVarInt(playerid, "WantedTimer", SetTimerEx("WantedLevelDown", 900000, 1, "i", playerid));

             format(string,sizeof(string), "You've stolen a law enforcement vehicle, wanted level increased.");
             SendClientMessage(playerid,COLOR_GREEN, string);

             GetPlayerName(playerid, pname, sizeof(pname));
             format(string,sizeof(string),"[LAW RADIO] suspect %s(%d) is last seen at %s. [Crime: Law Vehicle Robbery]",pname,playerid,zone);
             SendLawEnfMessage(COLOR_BLUE,string);
           }
       }
    }
    return 1;
}
maybe the solution would be in you


Re: Increase wanted level if in LVPD car - MP2 - 18.07.2013

Change GetPlayerVehicleID to GetVehicleModel.


Re: Increase wanted level if in LVPD car - _Khaled_ - 18.07.2013

still no effect

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        //Law Enforcement Vehicles +4 stars
        if(GetVehicleModel(playerid) == 598 || GetVehicleModel(playerid)== 523 || GetVehicleModel(playerid) == 490)
        {
           if(gTeam[playerid] == TEAM_CIVIL)
           {
             GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
             SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
             SetPVarInt(playerid, "WantedTimer", SetTimerEx("WantedLevelDown", 900000, 1, "i", playerid));

             format(string,sizeof(string), "You've stolen a law enforcement vehicle, wanted level increased.");
             SendClientMessage(playerid,COLOR_GREEN, string);

             GetPlayerName(playerid, pname, sizeof(pname));
             format(string,sizeof(string),"[LAW RADIO] suspect %s(%d) is last seen at %s. [Crime: Law Vehicle Robbery]",pname,playerid,zone);
             SendLawEnfMessage(COLOR_BLUE,string);
           }
       }
    }



Re: Increase wanted level if in LVPD car - SuperViper - 18.07.2013

pawn Код:
GetVehicleModel(GetPlayerVehicleID(playerid))



Re: Increase wanted level if in LVPD car - _Khaled_ - 18.07.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
GetVehicleModel(GetPlayerVehicleID(playerid))
That made it work!
thank you

and thank you MP2 also