vehicletheft not working
#4

Use a switch instead, uses less resources and should work better.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        switch(GetVehicleModel(vehicleid))
        }
        case 416, 497, 427, 490, 596, 597, 598, 599, 253:
        {
                {
                        if(StoleCopCarRecently == false)
                        {
                        if(gTeam[playerid] != POLICE || MEDIC || FBI)
                        {
                                CommitCrime(playerid, 6, "LEO Vehicle Theft");
                                        StoleCopCarRecently = true;
                                        SetTimer("SCCR", 1000 * 60, false);
                        }
                }
        default:
        {
                if(StoleCarRecently == false)
                {
                if(gTeam[playerid] != POLICE || MEDIC || FBI)
                {
                        CommitCrime(playerid, 1, "Vehicle Theft");
                                StoleCarRecently = true;
                                SetTimer("SCR", 1000 * 60, false);
                }
                }
                                }
                        }
                        {
                }
            }
        }
        return 1;
}
This is only an example, im a bit confused by your indentation, so the brackets might not match.
Reply


Messages In This Thread
vehicletheft not working - by Markus1337 - 13.01.2015, 05:50
Re: vehicletheft not working - by CalvinC - 13.01.2015, 06:04
Re: vehicletheft not working - by Markus1337 - 13.01.2015, 06:10
Re: vehicletheft not working - by CalvinC - 13.01.2015, 06:22
Re: vehicletheft not working - by Markus1337 - 13.01.2015, 12:55

Forum Jump:


Users browsing this thread: 1 Guest(s)