SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/05/2013, 11:55 PM   #1
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Question Pawno Crash?

I'm adding a Engine system, and when I compile the gamemode it crashes?

The script.
pawn Code:
forward StartEngine(playerid);
forward DamagedEngine(playerid);
OnPlayerStateChange:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    new vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;
    switch (newstate)
    {
        case PLAYER_STATE_DRIVER:
        {
            vid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, Name, sizeof(Name));
            if (AVehicleData[vid][Owned] == true)
            {
                if (strcmp(AVehicleData[vid][Owner], Name, false) != 0)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerCannotUseVehicle, AVehicleData[vid][Owner]);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
                if (AVehicleData[vid][Clamped] == true)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle2);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPolice)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
                        {
                            RemovePlayerFromVehicle(playerid);
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a police vehicle!");
                        }
                    }
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPilot)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehicleShamal, VehicleNevada, VehicleStuntPlane, VehicleDodo, VehicleMaverick, VehicleCargobob:
                        {
                            // Force the player out of the vehicle
                            RemovePlayerFromVehicle(playerid);
                            // Turn off the lights and engine
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            // Let the player know he cannot use a cop car
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a pilot vehicle!");
                        }
                    }
                }
            }
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            TogglePlayerControllable(playerid, 0);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Note: {FFFFFF}Your vehicle is not started!");
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Press SHIFT to start the engine.");
        }
        else if(VehicleEngine[vehicleid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Engine is currently running..");
        }
    }
    return 1;
}

Look for OnPlayerKeyStateChange:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassPolice:
        {
            if (((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
                Police_FineNearbyPlayers(playerid);
            if (((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
                Police_WarnNearbyPlayers(playerid);
        }
        case ClassAssistance:
        {
            if (((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
                Assistance_FixVehicle(playerid);
            if (((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
                Assistance_FixOwnVehicle(playerid);
        }
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleTowTruck)
    {
        if(newkeys & KEY_FIRE)
        {
            new closest = GetClosestVehicle(playerid);
            if(VehicleToPlayer(playerid, closest) < 10)
                AttachTrailerToVehicle(closest, GetPlayerVehicleID(playerid));
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            if(newkeys == KEY_JUMP)
            {
                VehicleEngine[vehicleid] = 2;
                SetTimerEx("StartEngine", 3000, 0, "i", playerid);
                SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Starting {FFFFFF}engine..");
            }
        }
        if(newkeys == KEY_SECONDARY_ATTACK)
        {
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
        }
    }
    return 1;
}
Put dis under of gamemode:
public StartEngine(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:health;
    new rand = random(2);

    GetVehicleHealth(vehicleid, health);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 2)
        {
            if(health > 300)
            {
                if(rand == 0)
                {
                    VehicleEngine[vehicleid] = 1;
                    TogglePlayerControllable(playerid, 1);
                    SetTimerEx("DamagedEngine", 1000, 1, "i", playerid);
                    SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Engine started!");
                }
                if(rand == 1)
                {
                    VehicleEngine[vehicleid] = 0;
                    TogglePlayerControllable(playerid, 0);
                    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Engine failed to start!");
                }
            }
            else
            {
                VehicleEngine[vehicleid] = 0;
                TogglePlayerControllable(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}The vehicle failed to start because of too much damage!");
            }
        }
    }
    return 1;
}

public DamagedEngine(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:health;

    GetVehicleHealth(vehicleid, health);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 1)
        {
            if(health < 300)
            {
                VehicleEngine[vehicleid] = 0;
                TogglePlayerControllable(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vehicle stopped because of too much damage!");
            }
        }
    }
    return 1;
}

Last edited by NathNathii; 09/05/2013 at 12:03 PM.
NathNathii is offline   Reply With Quote
Old 09/05/2013, 02:45 AM   #2
vvhy
Big Clucker
 
Join Date: Mar 2012
Posts: 145
Reputation: 11
Default Re: Pawno Crash?

I think you just missed some brackets.
Try this:
pawn Code:
forward StartEngine(playerid);
forward DamagedEngine(playerid);
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    new vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;
    switch (newstate)
    {
        case PLAYER_STATE_DRIVER:
        {
            vid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, Name, sizeof(Name));
            if (AVehicleData[vid][Owned] == true)
            {
                if (strcmp(AVehicleData[vid][Owner], Name, false) != 0)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerCannotUseVehicle, AVehicleData[vid][Owner]);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
                if (AVehicleData[vid][Clamped] == true)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle2);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPolice)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
                        {
                            RemovePlayerFromVehicle(playerid);
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a police vehicle!");
                        }
                    }
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPilot)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehicleShamal, VehicleNevada, VehicleStuntPlane, VehicleDodo, VehicleMaverick, VehicleCargobob:
                        {
                            // Force the player out of the vehicle
                            RemovePlayerFromVehicle(playerid);
                            // Turn off the lights and engine
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            // Let the player know he cannot use a cop car
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a pilot vehicle!");
                        }
                    }
                }
            }
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            TogglePlayerControllable(playerid, 0);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Note: {FFFFFF}Your vehicle is not started!");
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Press SHIFT to start the engine.");
        }
        else if(VehicleEngine[vehicleid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Engine is currently running..");
        }
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassPolice:
        {
            if(((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
                Police_FineNearbyPlayers(playerid);
            if(((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
                Police_WarnNearbyPlayers(playerid);
        }
        case ClassAssistance:
        {
            if(((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
            {
                Assistance_FixVehicle(playerid);
            }
            if(((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
            {
                Assistance_FixOwnVehicle(playerid);
            }
        }
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleTowTruck)
    {
        if(newkeys & KEY_FIRE)
        {
            new closest = GetClosestVehicle(playerid);
            if(VehicleToPlayer(playerid, closest) < 10)
                AttachTrailerToVehicle(closest, GetPlayerVehicleID(playerid));
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            if(newkeys == KEY_JUMP)
            {
                VehicleEngine[vehicleid] = 2;
                SetTimerEx("StartEngine", 3000, 0, "i", playerid);
                SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Starting {FFFFFF}engine..");
            }
        }
        if(newkeys == KEY_SECONDARY_ATTACK)
        {
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
        }
    }
    return 1;
}

public StartEngine(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:health;
    new rand = random(2);

    GetVehicleHealth(vehicleid, health);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 2)
        {
            if(health > 300)
            {
                if(rand == 0)
                {
                    VehicleEngine[vehicleid] = 1;
                    TogglePlayerControllable(playerid, 1);
                    SetTimerEx("DamagedEngine", 1000, 1, "i", playerid);
                    SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Engine started!");
                }
                if(rand == 1)
                {
                    VehicleEngine[vehicleid] = 0;
                    TogglePlayerControllable(playerid, 0);
                    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Engine failed to start!");
                }
            }
            else
            {
                VehicleEngine[vehicleid] = 0;
                TogglePlayerControllable(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}The vehicle failed to start because of too much damage!");
            }
        }
    }
    return 1;
}

public DamagedEngine(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:health;

    GetVehicleHealth(vehicleid, health);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 1)
        {
            if(health < 300)
            {
                VehicleEngine[vehicleid] = 0;
                TogglePlayerControllable(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vehicle stopped because of too much damage!");
            }
        }
    }
    return 1;
}
__________________
My work:
__________________________________________________ ______
MAPS

House Interior
Bank Interior
vvhy is offline   Reply With Quote
Old 09/05/2013, 03:09 AM   #3
Skyrise
Banned
 
Join Date: Jun 2012
Location: SA-MP
Posts: 144
Reputation: 89
Default Re: Pawno Crash?



These need to be commented out or removed. They are not actual code and the compiler is trying to compile it as code.

pawn Code:
// This is a comment

/* This is a
comment
block
*/
Skyrise is offline   Reply With Quote
Old 09/05/2013, 11:37 AM   #4
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: Pawno Crash?

Code:
C:\Users\***\\Documents\GT Testing\gamemodes\GranTrucking.pwn(2088) : error 021: symbol already defined: "OnPlayerStateChange"
C:\Users\***\Documents\GT Testing\gamemodes\GranTrucking.pwn(2174) : error 021: symbol already defined: "OnPlayerKeyStateChange"
Line 2088
pawn Code:
public OnPlayerStateChange(playerid,newstate,oldstate)
{

Line 2174
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
NathNathii is offline   Reply With Quote
Old 09/05/2013, 02:00 PM   #5
MrTinder
Big Clucker
 
Join Date: Sep 2012
Posts: 148
Reputation: 2
Default Re: Pawno Crash?

search and then remove empty

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

and

pawn Code:
public OnPlayerStateChange(playerid,newstate,oldstate)
MrTinder is offline   Reply With Quote
Old 09/05/2013, 05:24 PM   #6
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: Pawno Crash?

I don't understand what you mean (._. )
NathNathii is offline   Reply With Quote
Old 09/05/2013, 11:12 PM   #7
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: Pawno Crash?

Anyone that can FIX the script?
NathNathii is offline   Reply With Quote
Old 16/05/2013, 01:00 PM   #8
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: Pawno Crash?

Bump.
NathNathii is offline   Reply With Quote
Old 16/05/2013, 01:11 PM   #9
Threshold
High-roller
 
Threshold's Avatar
 
Join Date: Nov 2012
Location: Australia
Posts: 3,125
Reputation: 529
Default Re: Pawno Crash?

These two errors mean you have these callbacks more than once in the same script.

Code:
C:\Users\***\\Documents\GT Testing\gamemodes\GranTrucking.pwn(2088) : error 021: symbol already defined: "OnPlayerStateChange"
C:\Users\***\Documents\GT Testing\gamemodes\GranTrucking.pwn(2174) : error 021: symbol already defined: "OnPlayerKeyStateChange"
So basically, you have more than one OnPlayerStateChange, and more than one OnPlayerKeyStateChange. You need to delete whatever one has the least code in it, and move it to the other one. Currently you have something like this:

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

//Located somewhere else in your script:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    new vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;
    switch (newstate)
    {
        case PLAYER_STATE_DRIVER:
        {
            vid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, Name, sizeof(Name));
            if (AVehicleData[vid][Owned] == true)
            {
                if (strcmp(AVehicleData[vid][Owner], Name, false) != 0)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerCannotUseVehicle, AVehicleData[vid][Owner]);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
                if (AVehicleData[vid][Clamped] == true)
                {
                    RemovePlayerFromVehicle(playerid);
                    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                    SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                    format(Msg, 128, TXT_SpeedometerClampedVehicle2);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPolice)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
                        {
                            RemovePlayerFromVehicle(playerid);
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a police vehicle!");
                        }
                    }
                }
            }
            if (APlayerData[playerid][PlayerClass] != ClassPilot)
            {
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    switch (GetVehicleModel(vid))
                    {
                        case VehicleShamal, VehicleNevada, VehicleStuntPlane, VehicleDodo, VehicleMaverick, VehicleCargobob:
                        {
                            // Force the player out of the vehicle
                            RemovePlayerFromVehicle(playerid);
                            // Turn off the lights and engine
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            // Let the player know he cannot use a cop car
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Error: {FFFFFF}You can not use a pilot vehicle!");
                        }
                    }
                }
            }
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            TogglePlayerControllable(playerid, 0);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Note: {FFFFFF}Your vehicle is not started!");
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Press SHIFT to start the engine.");
        }
        else if(VehicleEngine[vehicleid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Engine is currently running..");
        }
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassPolice:
        {
            if(((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
                Police_FineNearbyPlayers(playerid);
            if(((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
                Police_WarnNearbyPlayers(playerid);
        }
        case ClassAssistance:
        {
            if(((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
            {
                Assistance_FixVehicle(playerid);
            }
            if(((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
            {
                Assistance_FixOwnVehicle(playerid);
            }
        }
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleTowTruck)
    {
        if(newkeys & KEY_FIRE)
        {
            new closest = GetClosestVehicle(playerid);
            if(VehicleToPlayer(playerid, closest) < 10)
                AttachTrailerToVehicle(closest, GetPlayerVehicleID(playerid));
        }
    }
    new vehicleid = GetPlayerVehicleID(playerid);

    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VehicleEngine[vehicleid] == 0)
        {
            if(newkeys == KEY_JUMP)
            {
                VehicleEngine[vehicleid] = 2;
                SetTimerEx("StartEngine", 3000, 0, "i", playerid);
                SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Starting {FFFFFF}engine..");
            }
        }
        if(newkeys == KEY_SECONDARY_ATTACK)
        {
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
        }
    }
    return 1;
}

So you need to remove the first two empty callbacks, so that you are only left with the callbacks that contain code.
__________________


Kar's Cops and Robbers 2020
Threshold is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Please my pawno.exe crash Erreur Scripting Help 1 05/02/2013 06:05 PM
My PAWNO crash Dare Devil..... Scripting Help 10 31/05/2012 12:00 PM
Help with pawno crash(rep++) Join7 Scripting Help 4 16/04/2012 05:31 PM
Pawno Crash Nuke547 Client Support 5 22/02/2012 10:09 AM
Pawno Crash UberSocks Help Archive 6 04/10/2009 09:43 AM


All times are GMT. The time now is 06:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.