Big Help Needed!
#3

Quote:
Originally Posted by Paladin
Посмотреть сообщение
pawn Код:
new Var[2]; // New Variable that checks the vehicle ID
new VarTaken[2]; // New Variable that checks what player is in the car

public OnGameModeInit()
{
    VarTaken[0] = 552;
    VarTaken[1] = 552;
    Var[0] = CreateVehicle(VEHICLE INFO) // Spawn Vehicle 1
    Var[1] = CreateVehicle(VEHICLE INFO) // Spawn Vehicle 2
    return 1;
}
public OnPlayerDisconnect(playerid, reason) // If player disconnects from server
{
    for(new v = 0; v < 1; v ++) // Calculates all vehicle variables
    {
    if(VarTaken[v] == playerid) // Checks if any player was assigned to that cars variable
    {
    VarTaken[v] = 552; // If they were, it sets the variable to 552, which means none
    return 1;
        }
    }
    return 1;
}

public OnPlayerSpawn(playerid) // On Player Spawn to set them in vehicle
{
    if(VarTaken[0] == 552) // Checks if Vehicle 1 is taken
    {
    PutPlayerInVehicle(playerid, Var[0], 0);
    VarTaken[0] = playerid;
    }
    else if(VarTaken[1] == 552) // If vehicle 1 is taken, it checks if vehicle 2 is taken
    {
    PutPlayerInVehicle(playerid, Var[1], 0);
    VarTaken[1] = playerid;
    }
    else // If all vehicles are taken, it goes to the else
    {
    // There is no space for another player
    return 1;
    }
    return 1;
}
wtf lol, that is hard to understand with all those variables... i made one once a time for an friend a lot simpler, he had an derby gamemode but too bad i lost the source

Anyways if it doesnt work for you check out the standard GrandLarc gamemode, It has random spawnpoints so you can see how it works. Then you can easily putting them in a vehicle with PutPlayerInVehicle (https://sampwiki.blast.hk/wiki/PutPlayerInVehicle)
Reply


Messages In This Thread
Big Help Needed! - by fie - 31.08.2010, 15:04
Re: Big Help Needed! - by Paladin - 31.08.2010, 17:59
Re: Big Help Needed! - by gamer931215 - 31.08.2010, 18:10
Re: Big Help Needed! - by Paladin - 31.08.2010, 18:12
Re: Big Help Needed! - by gamer931215 - 31.08.2010, 18:19
Re: Big Help Needed! - by Paladin - 31.08.2010, 18:22
Re: Big Help Needed! - by gamer931215 - 31.08.2010, 18:42
Re: Big Help Needed! - by Paladin - 31.08.2010, 18:50
Re: Big Help Needed! - by gamer931215 - 31.08.2010, 18:52
Re: Big Help Needed! - by Crusher!! - 31.08.2010, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)