public OnGameModeInit()
{
new adminbike;
// Don't use these lines if it's a filterscript
SetGameModeText("Gangwar TDM!");
//admin vehicles
adminbike = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,10000); // admin_nrg1
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == adminbike && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
SendClientMessage(playerid, 0xAA3333AA, "This vehicle is for admins only!");
}
return 1;
}
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\GWTDM.pwn(61) : warning 204: symbol is assigned a value that is never used: "adminbike" C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\GWTDM.pwn(131) : error 017: undefined symbol "adminbike" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
you will be credited in script XD
new []; new []; new []; new []; public OnGameModeInt create the cars and do the same :)
new AdminVehicles[Amount + 1]; // this will be the global variable, dont remove the +1, otherwise it will give you an error.
// also change 'amount' to the amount of vehicles are for admin only
AdminVehicles[0] = CreateVehicle(....);
AdminVehicles[1] = CreateVehicle(....);
new AdminVehicles[10 + 1];
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Gangwar TDM!");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
//grove cars
AddStaticVehicle(439,2488.2041,-1662.5435,13.1441,62.3311,86,86); // grovecar1
AddStaticVehicle(575,2474.6104,-1671.9984,13.1387,45.3853,86,86); // grovecar2
AddStaticVehicle(567,2480.3875,-1698.2565,13.3321,179.3588,86,86); // grovecar3
AddStaticVehicle(461,2473.9429,-1696.2106,13.3232,182.9979,86,86); // grovecar4
//admin vehicles
AdminVehicles[0] = AddStaticVehicleEx(522,2434.1450,-1675.1233,13.4768,181.4236,1,0,10000); // admin_nrg1
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == AdminVehicles[0] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
return 1;
}
both credited and rep given
|
so under the OnPlayerEnterVehicle if
pawn Код:
pawn Код:
both credited and rep given |
#define ADMINVEHICLES 10 // this will be the amount of admin vehicles you want
new AdminVehicles[ADMINVEHICLES+1]; // change the global variable to this one
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for( new i = 0; i < sizeof(ADMINVEHICLES); i++ ) // looping through every admin vehicle you made
{
if(vehicleid == AdminVehicles[i] && !IsPlayerAdmin(playerid))
{
ClearAnimations(playerid);
GameTextForPlayer(playerid,"Admin Vehicle",3000,4);
}
}
return 1;
}
|
That would be loads of work when checking if its an AdminVehicle[#].
Easier way to check it is like this: pawn Код:
|