Vehicle as objective
#1

Hello,

I'm creating a mission and I want to make so that the vehicle will be seen for all players on minimap as objective.

I'm using the SetVehicleParams and set the objective to 1. As I want, you can see the vehicle as objective on the minimap and a yellow arrow is attached to the vehicle, however, players who are far are not able to see that objective on their minimap.

I am a bit of confused here, any idea?

I have had a look to rivashell gamemode which is inside the samp server package.

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    // Note for SA-MP 0.3:
    // As the vehicle streams in, player team dependant params are applied. They can't be
    // applied to vehicles that don't exist in the player's world.
   
    if(vehicleid == OBJECTIVE_VEHICLE_BLUE) {
        if(gTeam[forplayerid] == TEAM_GREEN) {
            SetVehicleParamsForPlayer(OBJECTIVE_VEHICLE_BLUE,forplayerid,1,1); // objective; locked
        }
        else if(gTeam[forplayerid] == TEAM_BLUE) {
            SetVehicleParamsForPlayer(OBJECTIVE_VEHICLE_BLUE,forplayerid,1,0); // objective; unlocked
        }
    }
    else if(vehicleid == OBJECTIVE_VEHICLE_GREEN) {
        if(gTeam[forplayerid] == TEAM_BLUE) {
            SetVehicleParamsForPlayer(OBJECTIVE_VEHICLE_GREEN,forplayerid,1,1); // objective; locked
        }
        else if(gTeam[forplayerid] == TEAM_GREEN) {
            SetVehicleParamsForPlayer(OBJECTIVE_VEHICLE_GREEN,forplayerid,1,0); // objective; unlocked
        }
    }
   
    return 1;
    //printf("GameMode: VehicleStreamIn(%d,%d)",vehicleid,forplayerid);
}
Is this the actual method to make the yellow marked visible for everyone on the minimap?
Reply
#2

onvehiclestreamin, that's your problem.
Reply
#3

Quote:
Originally Posted by Ada32
Посмотреть сообщение
onvehiclestreamin, that's your problem.
What's the problem? I need to make like in single player, yellow arrow on vehicle can be seen from thousand miles away from the vehicle. Right now, the yellow arrow on the vehicle is getting streamed only when players are near. You can't see the yellow square on the minimap if you aren't near enough to the vehicle.

What I want to do is to make players be able to see that yellow marker from far away, so it can work as an objective to get in it. Same way as when a checkpoint works, you can see the red square of the checkpoint even if you are miles away.

You didn't explain anything properly. Using or not using the OnVehicleStreamedIn, doesn't make any difference at all.

I think I found the actual solution with a lot of code which I didn't want to do before, thought there was a more accurate way.

Well, there is something called map icons and if you look at map icon id's there is id 0 which is used for objectives in single player. I got with an idea of attaching it to vehicle, either with a timer or OnPlayerUpdate etc. I don't know if that is a way of properly doing that but it makes sense for the type of a thing I am trying to make.
Reply
#4

Quote:
Originally Posted by op
the yellow arrow on the vehicle is getting streamed only when players are near. You can't see the yellow square on the minimap if you aren't near enough to the vehicle.
that's because onvehiclestreamin is called when a vehicle is streamed to a player's client. solution? use something else..

edit;
Quote:
Originally Posted by op
What I want to do is to make players be able to see that yellow marker from far away, so it can work as an objective to get in it. Same way as when a checkpoint works, you can see the red square of the checkpoint even if you are miles away.
then use checkpoints..
Reply
#5

Quote:
Originally Posted by Ada32
Посмотреть сообщение
that's because onvehiclestreamin is called when a vehicle is streamed to a player's client. solution? use something else..

edit;


then use checkpoints..
The idea with map icons is a total fail. They are flashing on the map because of deletion and recreation at the positions.

I don't want to use checkpoints, there must be something else to make it possible to work. On single player there is even blue arrow attached to the vehicle and showing the blue square on the minimap.
Reply
#6

attach color marker objects to a vehicle and use setplayermapicon (markertype 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)