Jump to content
  • 0

Question

Posted

Am o un server ppc_trucking6 si am adaugat niste tool-gates iar cand te apropii de ele se deschid in sus si se invurtesc cateva grade si asa raman din includele PPC_Toll.inc este ok, nare probleme

Ma puteti ajuta?

560x95_F01616_1625F2_030303_000000.png

8 answers to this question

Recommended Posts

Posted

Fara script nu ne putem da seama ..

Edit:

Nu prea le am cu modul trucking dar incarca asta :

[pawn]// This file holds all functions for the toll-system

forward Toll();

public Toll()

{

// Loop through all players

    for(new playerid; playerid < MAX_PLAYERS; playerid++)

{

// If the player isn't connected, skip to the next player

        if(APlayerData[playerid][LoggedIn] == false) continue;

// Check if the player is the driver of a vehicle

if (GetPlayerVehicleSeat(playerid) == 0)

{

// Loop through all toll-gates

for (new TollGate; TollGate < MAX_TOLLGATES; TollGate++)

{

// Check if this toll-gate exists

if (ATollGates[TollGate][GateID] != 0)

{

    // Check if the player is in range of the tollgate

        if(IsPlayerInRangeOfPoint(playerid, 7.5, ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ]))

        {

// Check if the toll-gate is closed

            if(ATollGates[TollGate][GateStatus] == 0)

{

    // Open the gate

                MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][OpenX], ATollGates[TollGate][OpenY], ATollGates[TollGate][OpenZ], 3.0);

// Set status to OPEN

                ATollGates[TollGate][GateStatus] = 1;

                // Let the player pay the toll

                RewardPlayer(playerid, -ATollGates[TollGate][TollPrice], 0);

                new string[50];

                format(string, sizeof(string), TXT_PlayerPaysToll, ATollGates[TollGate][TollPrice]);

                GameTextForPlayer(playerid, string, 3000, 4);

                // Start a timer that closes the gate after 5 seconds

                SetTimerEx("CloseGate", 5000, false, "i", TollGate);

}

        }

}

}

}

    }

}

forward CloseGate(TollGate);

public CloseGate(TollGate)

{

    // Close the gate

MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ], 3.0);

// Set status to CLOSED

ATollGates[TollGate][GateStatus] = 0;

}

[/pawn]

Cauti scripter / Mapper pentru servarul tau ? [email protected] [FREE SCRIPTING]

Posted

Aici includele PPC_toll.inc

[pawn]// This file holds all functions for the toll-system

forward Toll();

public Toll()

{

// Loop through all players

    for(new playerid; playerid < MAX_PLAYERS; playerid++)

{

// If the player isn't connected, skip to the next player

        if(APlayerData[playerid][LoggedIn] == false) continue;

// Check if the player is the driver of a vehicle

if (GetPlayerVehicleSeat(playerid) == 0)

{

// Loop through all toll-gates

for (new TollGate; TollGate < MAX_TOLLGATES; TollGate++)

{

// Check if this toll-gate exists

if (ATollGates[TollGate][GateID] != 0)

{

    // Check if the player is in range of the tollgate

        if(IsPlayerInRangeOfPoint(playerid, 7.5, ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ]))

        {

// Check if the toll-gate is closed

            if(ATollGates[TollGate][GateStatus] == 0)

{

    // Open the gate

                MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][OpenX], ATollGates[TollGate][OpenY], ATollGates[TollGate][OpenZ], 3.0);

// Set status to OPEN

                ATollGates[TollGate][GateStatus] = 1;

                // Let the player pay the toll

                RewardPlayer(playerid, -ATollGates[TollGate][TollPrice], 0);

                new string[50];

                format(string, sizeof(string), TXT_PlayerPaysToll, ATollGates[TollGate][TollPrice]);

                GameTextForPlayer(playerid, string, 3000, 4);

                // Start a timer that closes the gate after 5 seconds

                SetTimerEx("CloseGate", 5000, false, "i", TollGate);

}

        }

}

}

}

    }

}

forward CloseGate(TollGate);

public CloseGate(TollGate)

{

    // Close the gate

MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ], 3.0);

// Set status to CLOSED

ATollGates[TollGate][GateStatus] = 0;

}

[/pawn]

560x95_F01616_1625F2_030303_000000.png
Posted

Incarca asta

[pawn]// This file holds all functions for the toll-system

forward Toll();

public Toll()

{

// Loop through all players

    for(new playerid; playerid < MAX_PLAYERS; playerid++)

{

// If the player isn't connected, skip to the next player

        if(APlayerData[playerid][LoggedIn] == false) continue;

// Check if the player is the driver of a vehicle

if (GetPlayerVehicleSeat(playerid) == 0)

{

// Loop through all toll-gates

for (new TollGate; TollGate < MAX_TOLLGATES; TollGate++)

{

// Check if this toll-gate exists

if (ATollGates[TollGate][GateID] != 0)

{

    // Check if the player is in range of the tollgate

        if(IsPlayerInRangeOfPoint(playerid, 7.5, ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ]))

        {

// Check if the toll-gate is closed

            if(ATollGates[TollGate][GateStatus] == 0)

{

    // Open the gate

                MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][OpenX], ATollGates[TollGate][OpenY], ATollGates[TollGate][OpenZ], 3.0);

// Set status to OPEN

                ATollGates[TollGate][GateStatus] = 1;

                // Let the player pay the toll

                RewardPlayer(playerid, -ATollGates[TollGate][TollPrice], 0);

                new string[50];

                format(string, sizeof(string), TXT_PlayerPaysToll, ATollGates[TollGate][TollPrice]);

                GameTextForPlayer(playerid, string, 3000, 4);

                // Start a timer that closes the gate after 5 seconds

                SetTimerEx("CloseGate", 5000, false, "i", TollGate);

}

        }

}

}

}

    }

}

forward CloseGate(TollGate);

public CloseGate(TollGate)

{

    // Close the gate

MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][CloseX], ATollGates[TollGate][CloseY], ATollGates[TollGate][CloseZ], 3.0);

// Set status to CLOSED

ATollGates[TollGate][GateStatus] = 0;

}

[/pawn]

Cauti scripter / Mapper pentru servarul tau ? [email protected] [FREE SCRIPTING]

Posted

Nu a mers. In GameModeInit.inc am portile:

[pawn]GameModeInit_Toll()

{

// Add toll-houses to the world

CreateObject(9623, 1787.00, 695.50, 17.40, -3.5, 0.0, 350.25); //object(toll_sfw) (1)

// Add a toll-gate to the world

AddTollGate(3578, -2668.25, 1274.50, 50.0, -2668.25, 1274.50, 55.0, 0.0, 0.0, 0.0, 300);

AddTollGate(3578, -2677.75, 1274.50, 50.0, -2677.75, 1274.50, 55.0, 0.0, 0.0, 0.0, 300);

AddTollGate(3578, -2686.25, 1274.50, 50.0, -2686.25, 1274.50, 55.0, 0.0, 0.0, 0.0, 300);

AddTollGate(3578, -2694.75, 1274.50, 50.0, -2694.75, 1274.50, 55.0, 0.0, 0.0, 0.0, 300);

AddTollGate(980, -1955.59998, -1343.5, 47.8, -1955.59998, -1343.5, 42.4, 0.0, 0.0, 226, 300);

AddTollGate(980, -1912, -1363.40002, 47.6, -1912, -1363.40002, 42.2, 0.0, 0.0, 152, 300);

AddTollGate(980, -1819.40002, -595.20001, 23.5, -1819.40002, -595.20001, 18, 0.0, 0.0, 182, 300);

AddTollGate(980, -1763, -595, 23.5, -1763, -595, 17.7, 0.0, 0.0, 182, 300);

AddTollGate(980, 71.5, -1542.19995, 12, 71.5, -1542.19995, 6.5, 0.0, 0.0, 266, 300);

AddTollGate(980, 73.9, -1525.80005, 11.8, 73.9, -1525.80005, 6.5, 0.0, 0.0, 266, 300);

AddTollGate(980, -22.2, -1340.5, 18.2, -22.2, -1340.5, 12.8, 0.0, 0.0, 310, 300);

AddTollGate(980, -6.4, -1364, 18.4, -6.4, -1364, 12.4, 0.0, 0.0, 310, 300);

AddTollGate(980, 1769.90002, 664, 25, 1769.90002, 664, 19.2, 0.0, 0.0, 347.985, 300);

AddTollGate(980, 1789, 659.79999, 25, 1789, 659.79999, 19.2, 0.0, 0.0, 347.985, 300);

AddTollGate(980, 428.20001, 604.09998, 26.3, 428.20001, 604.09998, 20.7, 0.0, 0.0, 35.98, 300);

AddTollGate(980, -138, 481.5, 19, -138, 481.5, 13.2, 0.0, 0.0, 345.98, 300);

AddTollGate(980, -1130.5, 1099, 45.4, -1130.5, 1099, 39.8, 0.0, 0.0, 317.97, 300);

AddTollGate(980, -1141.40002, 1110.19995, 45.6, -1141.40002, 1110.19995, 39.8, 0.0, 0.0, 317.97, 300);

AddTollGate(980, 3437.8999, -1814, 17.3, 3437.8999, -1814, 12.3, 0.0, 0.0, 180, 300);

}

// This function is used to add toll-gates to the map

AddTollGate(GateModel, Float:OX, Float:OY, Float:OZ, Float:CX, Float:CY, Float:CZ, Float:RX, Float:RY, Float:RZ, TollMoney)

{

// Loop through all tollgates

for (new TollGate; TollGate < MAX_TOLLGATES; TollGate++)

{

// Check if this is an empty entry

if (ATollGates[TollGate][GateID] == 0)

{

// Create a new object for the toll-gate in it's closed status

ATollGates[TollGate][GateID] = CreateObject(GateModel, CX, CY, CZ, RX, RY, RZ);

// Set data

ATollGates[TollGate][TollPrice] = TollMoney; // Set the price to pay for passing the toll-gate

ATollGates[TollGate][GateStatus] = 0; // Set the status to CLOSED

ATollGates[TollGate][OpenX] = OX; // Save the OpenX coordinates

ATollGates[TollGate][OpenY] = OY; // Save the OpenY coordinates

ATollGates[TollGate][OpenZ] = OZ; // Save the OpenZ coordinates

ATollGates[TollGate][CloseX] = CX; // Save the CloseX coordinates

ATollGates[TollGate][CloseY] = CY; // Save the CloseY coordinates

ATollGates[TollGate][CloseZ] = CZ; // Save the CloseZ coordinates

break; // Stop the for-loop

}

}

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.