SA-MP Forums Archive
Need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help (/showthread.php?tid=185738)



Need help - marinov - 25.10.2010

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


Re: Need help - Arrows73 - 25.10.2010

Are the vehicle models the same or different ones?


Re: Need help - elcid7772 - 26.10.2010

RemovePlayerFromVehicle(playerid);


Re: Need help - marinov - 26.10.2010

there are like 3 models


Re: Need help - marinov - 26.10.2010

deleted


Re: Need help - Cameltoe - 26.10.2010

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");
}



Re: Need help - Lookin - 26.10.2010

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


Re: Need help - marinov - 26.10.2010

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 ?


Re: Need help - marinov - 26.10.2010

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


Re: Need help - Cameltoe - 26.10.2010

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 !!");
}