Changing to another map
#21

Quote:
Originally Posted by Pinguinn
View Post
Uhm....

Code:
/rcon mapname [name] - change the map name text (example: /rcon mapname San Andreas).
I don't think it changes the actual map
Instead this might work?

Code:
/rcon changemode [mode] - This command will change the current gamemode to the given one (example: if you want to play sftdm: /rcon changemode sftdm)
?? xD I know that "Arena 666" is a map from in-game lol, if we play there (or teleported to there) the map must change too
Reply
#22

Quote:
Originally Posted by Michael@Belgium
View Post
?? xD I know that "Arena 666" is a map from in-game lol, if we play there (or teleported to there) the map must change too
Does your 'Map' at server info change?
Reply
#23

Quote:
Originally Posted by Pinguinn
View Post
Does your 'Map' at server info change?
yes ...
Reply
#24

Quote:
Originally Posted by Michael@Belgium
View Post
yes ...
Do you spawn the vehicles before you put them in the vehicles?
Reply
#25

pawn Code:
new rand1=random(30);
PutPlayerInVehicle(i, CarMap1[rand1], 0);
You are here picking a random vehicle and putting the player in it, but it doesnt check if there already is a player in the vehicle does it ?

Because if you try calling PutPlayerInVehicle() and the seat is already occupied it will just ignore it and players will NOT be teleported in the vehicle.
Reply
#26

Quote:
Originally Posted by gamer931215
View Post
pawn Code:
new rand1=random(30);
PutPlayerInVehicle(i, CarMap1[rand1], 0);
You are here picking a random vehicle and putting the player in it, but it doesnt check if there already is a player in the vehicle does it ?

Because if you try calling PutPlayerInVehicle() and the seat is already occupied it will just ignore it and players will NOT be teleported in the vehicle.
OMG you're true ! xD So stupid .. but how to do it then ?
Reply
#27

Quote:
Originally Posted by Michael@Belgium
View Post
OMG you're true ! xD So stupid .. but how to do it then ?
Use a variable, like in this example:

pawn Code:
new bool:VehicleUsed[30];

//call this if you need a random id between 0/30
stock GetRandomVehicleID()
{
    for(new i = 0;i<30;i++)
    {
        if(!VehicleUsed[i])
        {
            VehicleUsed[i] = true;
            return i;
        }
    }
    return -1; //no vehicles left
}

//call this if youre changing your maps
stock ResetVehicles()
{
    for(new i = 0;i<30;i++)
    {
        VehicleUsed[i] = false;
    }
}
If your not always using 30 vehicles, then use a parameter to get the map like this:
pawn Code:
stock GetRandomVehicleID(map)
{
    switch(map)
    {
        case 0:
        {
            for(new i = 0;i<30;i++)
            {
                if(!VehicleUsed[i])
                {
                    VehicleUsed[i] = true;
                    return i;
                }
            }
        }
    }
    return -1; //no vehicles left
}
or just use the parameter to set the limit for the loop
Reply
#28

Quote:
Originally Posted by gamer931215
View Post
Use a variable, like in this example:

pawn Code:
new bool:VehicleUsed[30];

//call this if you need a random id between 0/30
stock GetRandomVehicleID()
{
    for(new i = 0;i<30;i++)
    {
        if(!VehicleUsed[i])
        {
            VehicleUsed[i] = true;
            return i;
        }
    }
    return -1; //no vehicles left
}

//call this if youre changing your maps
stock ResetVehicles()
{
    for(new i = 0;i<30;i++)
    {
        VehicleUsed[i] = false;
    }
}
If your not always using 30 vehicles, then use a parameter to get the map like this:
pawn Code:
stock GetRandomVehicleID(map)
{
    switch(map)
    {
        case 0:
        {
            for(new i = 0;i<30;i++)
            {
                if(!VehicleUsed[i])
                {
                    VehicleUsed[i] = true;
                    return i;
                }
            }
        }
    }
    return -1; //no vehicles left
}
or just use the parameter to set the limit for the loop
So in stead off
pawn Code:
new rand1=random(30);
PutPlayerInVehicle(i, CarMap1[rand1], 0);
I have to use this:
pawn Code:
PutPlayerInVehicle(i,GetRandomVehicleID(1),0);//for map 1
Reply
#29

Quote:
Originally Posted by Michael@Belgium
View Post
So in stead off
pawn Code:
new rand1=random(30);
PutPlayerInVehicle(i, CarMap1[rand1], 0);
I have to use this:
pawn Code:
PutPlayerInVehicle(i,GetRandomVehicleID(1),0);//for map 1
Yes, it will not exactly get a random id/spot, but it will just go from 1-2-3-4-5 etc
Reply
#30

Quote:
Originally Posted by [MWR]Blood
View Post
Try first setting their position.
Agreed
Reply
#31

why i should chek that ? even i don't chek it .. it still don't work x)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)