PDA

View Full Version : how to set group vehicles?


KiiD
14/06/2012, 10:25 AM
I'm wondering how I can set group vehicles, they are StaticEx vehicles currently. I don't want them to be owned at all but so only a group (lspd) can enter it. I've done it on my previous script but that was lost and now I forget how to do it, could anyone help? Oh also I'm using the Vortex Roleplay script so I dunno what the groups are, haven't done much editing on it yet.
Thanks in advance! :D

LSPD Car codes:

AddStaticVehicleEx(596,1538.6521,-1643.8551,5.6114,0.3763,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1534.4594,-1643.9315,5.6111,0.7681,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1530.6758,-1643.8883,5.6122,0.2093,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1526.5415,-1644.8464,5.6101,359.0425,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.4341,-1650.7209,5.6108,268.6504,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1545.9198,-1655.1847,5.6111,269.3193,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.1133,-1659.0970,5.6111,269.7953,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1545.6974,-1663.1766,5.6114,269.3921,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1545.7117,-1668.1542,5.6122,269.9950,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.1051,-1672.1013,5.6103,268.5573,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.2188,-1675.8765,5.6115,270.7572,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.2839,-1680.2635,5.6119,268.8784,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1546.1708,-1684.3844,5.6103,267.4834,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1528.1550,-1683.9926,5.6107,90.0151,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1527.7209,-1687.7395,5.6098,89.3488,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1558.6991,-1710.9421,5.6123,180.2686,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1570.3159,-1711.3695,5.6105,178.8237,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1574.5171,-1711.7734,5.6107,177.9018,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1578.7043,-1711.7899,5.6111,179.0981,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1583.2400,-1711.4156,5.6107,179.1913,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1587.7186,-1711.9297,5.6101,180.4345,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1591.2727,-1711.1183,5.6113,179.3488,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1595.1912,-1711.2340,5.6114,178.9715,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1602.5802,-1704.0601,5.6122,270.7455,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1602.5798,-1700.3209,5.6140,267.6759,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1602.6827,-1696.1542,5.6099,271.6746,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1603.0482,-1692.0115,5.6111,270.2421,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1602.6372,-1687.9850,5.6080,268.3775,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1602.6052,-1684.1044,5.6117,270.4548,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1584.4806,-1667.3932,5.6144,264.7286,0,1,100000); // LSPD CAR
AddStaticVehicleEx(596,1584.5867,-1671.4492,5.6141,271.2442,0,1,100000); // LSPD CAR

Stefand
14/06/2012, 11:25 AM
You will have some time with it but.

On top of script

#define team_lspd 1
new pTeam[MAX_PLAYERS];

new LSPDCAR1;
new LSPDCAR2;
new LSPDCAR3;

etc.



LSPDCAR1 = AddStaticVehicleEx(596,1538.6521,-1643.8551,5.6114,0.3763,0,1,100000);
LSPDCAR2 = AddStaticVehicleEx(596,1534.4594,-1643.9315,5.6111,0.7681,0,1,100000); // LSPD CAR
LSPDCAR3 = AddStaticVehicleEx(596,1530.6758,-1643.8883,5.6122,0.2093,0,1,100000); // LSPD CAR




public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInVehicle(playerid, LSPDCAR1) || IsPlayerInVehicle(playerid, LSPDCAR2) || IsPlayerInVehicle(playerid,LSPDCAR3))
{
SCM(playerid, RED, "you are not in the LSPD");
RemovePlayerFromVehicle(playerid);
}
else
{
if(pTeam[playerid] == team_lspd)
{
SCM(playerid, GREEN, "/engine to start the vehicle");
}
}
return 1;
}


Something like that, if you got an system for the groups let me know so I can help you.
Also if you got errors let me know (didn't test it)

Stefand
14/06/2012, 11:33 AM
Oh, you use vortex, /spawncar [id] /savecar /setcargroup 1 and done

KiiD
14/06/2012, 11:49 AM
Oh, you use vortex, /spawncar [id] /savecar /setcargroup 1 and done

Oh, thanks! That sounds ultra simple! xD
Awesome, rep + 1, thanks for the help.

Stefand
14/06/2012, 01:58 PM
Thanks for the REP, If you need any help with Vortex PM me, I'm currently editing that script, deleted a lot of things and added a lot more!