08.10.2011, 23:42
(
Last edited by DaRkAnGeL[NBK]; 09/10/2011 at 12:31 AM.
)
Welcome this is my second tutorial unfortunately the first was deleted so i hope to have more luck with this so basically ill show you how to create admin vehicles the easiest way possible okay so i shall start with single admin vehicles so firstly you will need a "new" so place this outside any function
this shows the compiler that its valid, however please note you can change AdminVehicle to what ever you want. Okay so thats that sorted, if done correctly you should get this:
that basically just means that its not being used which is good as its better then tones of errors! okay now in the
add
for tutorial sense i used grove street and a NRG-500 so my code would be:
okay so thats sorted now, you have your vehicle in place but with that AdminVehicle means nothing to pawno so now we add this to the
basically all you really need is ClearAnimations(playerid); & the top "if" statement, all this will do is unless the player is an rcon admin then it wont let them enter the car you can also use the similar method when create private cars there are a few tutorials on that else where however if you wanted to add multiple AdminVehicles then you would need to change this to
you must keep the +1 but the "amount" defines how many vehicles are admin only so now you must simply label your AdminVehicles like so
Also instead of
you will need to add [id] so if like mine you have [0] on your "AddStaticVehicle" line the create code should be
you can have any amount of this on your script just make sure you change the [amount +1] so say for example you have 10 AdminVehicles you will need
you will also need to add them in your "OnGameModeInit" and "OnPlayerEnterVehicle" so i have added them for you please note its all the same so please dont copy it as it will give you errors, also i have "AddStaticVehicleEx" that just allows me to add spawn delay to my vehicles
And then on my OnPlayerEnterVehicle
And thats it all done enjoy your new admin cars
IMPORTANT NOTE:You will have to be RCON admin to use them
CREDITS:
DaRkAnGeL[NBK]
Zonoya
Wesley221
Credits to the last two as this morning i didnt know how to create admin vehicles and after my thread received alot of viewers i decided to create this tutorial,
I Really Hope This Helps & Doesn't Get Deleted
Thanks XD
If you thought this tutorial was helpful please comment below also comment with any constructive criticism and any ideas for the next tutorial thanks
pawn Code:
new AdminVehicle;
Code:
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\tutorial.pwn(234) : warning 203: symbol is never used: "AdminVehicle" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
pawn Code:
public OnGameModeInit() //callback
pawn Code:
AdminVehicle = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2)
pawn Code:
AdminVehicles = AddStaticVehicle(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,); // admin_nrg1
pawn Code:
public OnPlayerEnterVehicle
pawn Code:
if(vehicleid == AdminVehicles && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
pawn Code:
new AdminVehicles[amount +1];
pawn Code:
AdminVehicles[0] = AddStaticVehicle(522,2434.1450,-1675.1233,13.4768,181.4236,1,0); // admin_nrg1
pawn Code:
if(vehicleid == AdminVehicles && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
pawn Code:
if(vehicleid == AdminVehicles[0] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
pawn Code:
new AdminVehicles[10 + 1];
pawn Code:
public OnGameModeInit();
AdminVehicles[0] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[1] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[2] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[3] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[4] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[5] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[6] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[7] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[8] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[9] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
AdminVehicles[10] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,60000); // admin_nrg1
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == AdminVehicles[0] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[1] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[2] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[3] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[4] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[5] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[6] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[7] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[8] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[9] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
if(vehicleid == AdminVehicles[10] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
return 1;
}
IMPORTANT NOTE:You will have to be RCON admin to use them
CREDITS:
DaRkAnGeL[NBK]
Zonoya
Wesley221
Credits to the last two as this morning i didnt know how to create admin vehicles and after my thread received alot of viewers i decided to create this tutorial,
I Really Hope This Helps & Doesn't Get Deleted
Thanks XD
If you thought this tutorial was helpful please comment below also comment with any constructive criticism and any ideas for the next tutorial thanks