PutPlayerInVehicle depending on Online Players...
#1

hi,

ive never used this function before so i checked it in the wiki and its kinda self explanatory but i still have a problem.
I want to make a kinda derby minigame, where all players are set into vehicles after a certain cmd has been executed.
But my question would be, how can i create exactly that many vehicles i need for the derby (cause there isnt always the same number of players on the server.)
And how can i put every player into another vehicle?

I hope you understand what i mean

thx in advance!
Reply
#2

Loop throguh all the players in the derby and put them in a vehicle.
Reply
#3

i know i have to loop through the certain players but thats not my problem...
Let me explain:

there are lets say 30 fixed positions for potential vehicles.
But there might be only 10 players on the server so only 10 vehicles shall be created on 10 of this fixed mentioned positions. The other positions shall stay empty.
Also if the vehicles are created i have to link it somehow to the PutPlayerInVehicle function cause u have to mention the vehicleID to put the player into the correct vehicle. But as the VehicleIDs are not always the same i dont know how to proceed. (I suck at explaining i know ) So i had to increase the vehicleID for every player that had been looped through. Thats my prob.
Reply
#4

Like this?
Код:
//new MyVehicles[31]; // Optional but suggested
// code
new pCount;
// After getting pCount
for (new i=0; i<pCount;i++)
{
CreateVehicle(...);
}
And of course I suggest making a glob. variable MyVehicles(or something) just to be able to destroy the vehicles, if statements, etc
Reply
#5

thx, thats what i wanted to know.
The prob is i didnt think about arrays here

thx!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)