Need help
#1

Hello, I finally got the gate /open and /close commands to work, now I have something else I wanna do.

How do I restrict some vehicles for a team ? like, if a guy in the A team try to get in a vehicle in the B team base, the guy won't be able to drive it
Reply
#2

Are the vehicle models the same or different ones?
Reply
#3

RemovePlayerFromVehicle(playerid);
Reply
#4

there are like 3 models
Reply
#5

deleted
Reply
#6

Like this:
pawn Код:
if(model == restrictedmodel && Teamvariable == theteamtorestrictto)
{
SendClientMessage(playerid, COLOR, "Go bust some ass !!!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR, "This vehicle is restricted to theteamtorestrictto");
}
Reply
#7

Quote:
Originally Posted by elcid7772
Посмотреть сообщение
RemovePlayerFromVehicle(playerid);
Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Like this:
pawn Код:
if(model == restrictedmodel && Teamvariable == theteamtorestrictto)
{
SendClientMessage(playerid, COLOR, "Go bust some ass !!!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR, "This vehicle is restricted to theteamtorestrictto");
}
what they said lol
Reply
#8

Ok, Im having some trouble creating a new team 2, can someone plz just create a new team called S.T.A.R.S (but don't put this on the menu), and put on my script for me ?
Reply
#9

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Like this:
pawn Код:
if(model == restrictedmodel && Teamvariable == theteamtorestrictto)
{
SendClientMessage(playerid, COLOR, "Go bust some ass !!!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR, "This vehicle is restricted to theteamtorestrictto");
}
what should I change "restrictedmodel && Teamvariable == theteamtorestrictto)" to ?
because there's more than one vehicle model

http://pastebin.com/YTy0j3MJ
Reply
#10

Quote:
Originally Posted by marinov
Посмотреть сообщение
what should I change "restrictedmodel && Teamvariable == theteamtorestrictto)" to ?
The Model part:
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411) // If model is an infernus continue..
The Team part:
pawn Код:
if(team[playerid] == 1) // If player team is 1 continue..
Putting them together:
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411 && team[playerid] == 1) // If model is an infernus && Player team is 1 continue..
Making an else condition:
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411 && team[playerid] == 1){ // If model is an infernus && Player team is 1 continue..
SendClientMessage(playerid, SOMECOLORHERE, "Go bust them !!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, SOMECOLORHERE, "Restricted to team 1 !!");
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)