More vehicles - 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)
+--- Thread: More vehicles (
/showthread.php?tid=637185)
More vehicles -
Slavica - 10.07.2017
https://sampforum.blast.hk/showthread.php?tid=160810
I found this tut on how to make factions and cars,but in the tutorial he creates only 1 car for each faction.
He is using enums to define the cars.How to add more cars?Do I need to add new enum and new everything for every car?
Re: More vehicles -
Meller - 10.07.2017
That tutorial is complete bs, try doing it from scratch yourself.
Re: More vehicles -
coool - 10.07.2017
That tutorial is outdated.. It uses gTeam instead of SetPlayerTeam. And it uses AddPlayerClass instead of AddPlayerClassEx for teams.
Re: More vehicles -
Slavica - 10.07.2017
I did,AND IT DID NOT WORK.
I tryed;
Код:
new pTeam[MAX_PLAYERS];
#define team_civili 0
#define team_policija 1
#define team_mafija 2
#define team_police_cars 25
#define team_mafija_cars 10
new PoliceCar[team_police_cars];
new MafijaCar[team_mafija_cars];
public OnGameModeInit()
{
PoliceCar[0] = CreateVehicle(599, -234.9609, 975.8903, -27.7522, -90.0000, 1, 1, 4000);
SetVehicleNumberPlate(PoliceCar[0], "Sheriff");
PoliceCar[1] = CreateVehicle(599, -234.9609, 971.8903, -27.7522, -90.0000, 1, 1, 4000);
SetVehicleNumberPlate(PoliceCar[1], "Sheriff");
/////////////////////////////////////////////////////
MafijaCar[0] = CreateVehicle(599, -234.9609, 975.8903, -27.7522, -90.0000, 1, 1, 4000);
MafijaCar[1] = CreateVehicle(599, -234.9609, 971.8903, -27.7522, -90.0000, 1, 1, 4000);
/////////////////////////////////////////////////////
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i = 0; i < sizeof(PoliceCar); i ++)
{
if(vehicleid == PoliceCar[i] && !pTeam[playerid] == 1)
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"~r~ Policija",2000,4);
}
}
for(new i = 0; i < sizeof(MafijaCar); i ++)
{
if(vehicleid == MafijaCar[i] && !pTeam[playerid] == 2)
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"~r~ Mafija",2000,4);
}
}
return 1;
}
Players cant enter the police vehicles if they arent officers but they can enter the other teams cars
Re: More vehicles -
Meller - 10.07.2017
http://forum.sa-mp.com/showthread.ph...48#post3899848
Why double post?
Re: More vehicles -
Slavica - 10.07.2017
This post is not about the same thing that post was.
I just simply told him what I already did.