How to lock a vehicle ?
#1

I need a help making that if someone from TEAM_GREEN wants to enter vehicle id 423 he can't
because it will be locked, so how can i lock vehicle id 423.
Reply
#2

SetVehicleParamsForPlayer()

https://sampwiki.blast.hk/wiki/Function:...aramsForPlayer
Reply
#3

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
I tried that long time ago and it doesn't help me at all I just get errors.
Reply
#4

Do you use SetPlayerTeam to set your teams?
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Do you use SetPlayerTeam to set your teams?
pawn Код:
public SetPlayerTeamFromClass(playerid,classid)
{
    if(classid == 0 || classid == 1 || classid == 2) {
        gTeam[playerid] = TEAM_GREEN;
    } else if(classid == 3 || classid == 4 || classid == 5) {
        gTeam[playerid] = TEAM_BLUE;
    }
}
Reply
#6

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(vehicleid == 423 && gTeam[forplayerid] == TEAM_GREEN)
    {
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
    }
    return 1;
}
If you mean 423 as vehicle model id, then

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(GetVehicleModel(vehicleid) == 423 && gTeam[forplayerid] == TEAM_GREEN)
    {
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
    }
    return 1;
}
Reply
#7

@ MadeMan

Thanks

Off topic: How can I detect if player is in checkpoint with vehicle id 423 ?
Reply
#8

https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint

https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint

https://sampwiki.blast.hk/wiki/GetPlayerVehicleID
Reply
#9

pawn Код:
new car1 (createvehicle..blabla
IsPlayerInVehicle(playerid,(car1));
{
   //type something here
}
else
{ sendclientmessage(playerid, Green," message");
}
something like this should work
Reply
#10

Quote:
Originally Posted by NoobScripter1
Посмотреть сообщение
pawn Код:
new car1 (createvehicle..blabla
IsPlayerInVehicle(playerid,(car1));
{
   //type something here
}
else
{ sendclientmessage(playerid, Green," message");
}
something like this should work
Not helpfull but thanks, I fixed the problem by myself.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)