vehicletheft not working
#1

http://pastebin.com/hpmmnPMq

I can't see the problem but it's obviously in there, it always give a normal vehicle theft even though I use a police vehicle.

So I get 2 types of vehicle thefts if i re-enter etc and then the timers run as they should b4 you can get wanted again from stealing the same car.

Bit tired, thanks in advance.
Reply
#2

You mean this doesn't get activated?
pawn Код:
CommitCrime(playerid, 6, "LEO Vehicle Theft");
StoleCopCarRecently = true;
SetTimer("SCCR", 1000 * 60, false);
I don't really understand what you mean.
Reply
#3

No it doesnt recognize the vehicleids properly, a civilian vehicle would give me a Vehicle theft and upon re-entering I will get a LEO vehicle theft even though the IDs aren't matching.

I'm thinking I did something wrong with the IDs but can't really spot it.
The IDs are correct but the way they're written might be what's causing it, idk.
Reply
#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
#5

NVM its working, ty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)