23.10.2015, 16:46
PHP код:
AddTollGate(Float:X, Float:Y, Float:Z, 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
CreateObject(966, X, Y, Z, RX, RY, RZ);
ATollGates[TollGate][GateID] = CreateObject(968, X, Y, Z+0.8, RX, RY-90.0, 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][TollX] = X; // Save the X coordinates
ATollGates[TollGate][TollY] = Y; // Save the Y coordinates
ATollGates[TollGate][TollZ] = Z; // Save the Z coordinates
ATollGates[TollGate][TollRX] = RX; // Save the RX coordinates
ATollGates[TollGate][TollRY] = RY; // Save the RY coordinates
ATollGates[TollGate][TollRZ] = RZ; // Save the RZ coordinates
break; // Stop the for-loop
}
}
}