You are not in the LSPD
#1

Hello guys!
I would like to know how to build a code for locking LSPD vehicles for civilians who aren't in LSPD as cops.
When you attemp to enter a LSPD vehicle so you get like "locked vehicle" and then you got on client message "You are not in the LSPD"
Here a picture:


Is it copyied from other mode?
*its not mine mode and i dont got PWN file
Reply
#2

You can't enter it because you are not a part of the LSPD
Reply
#3

@firemanjv - i want the code how to make it for only LSPD staff can enter LSPD vehicles and civlians not.
Reply
#4

There must be a variable that shows the faction of the player, for example PlayerInfo[playerid][pFaction], and another variable that shows the faction of vehicle, for example VehicleInfo[vID][vFaction]. Then, all you gotta do is;

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(VehicleInfo[vehicleid][vFaction] != PlayerInfo[playerid][pFaction])
     {
          new msg[128];
          format(msg, sizeof(msg), "You are not member of faction %d!", VehicleInfo[vehicleid][vFaction]);
          SendClientMessage(playerid, -1, msg);
     }
}
Just to give the idea.
Reply
#5

in the picture... you are civlian or LSPD ?
Reply
#6

i did /quitfaction, actually its my friend on the picture with cheats not me - you guys -rep me for nothing for cheats
Reply
#7

@Calabresi - BTW how do i create faction? I pawn beginner
Reply
#8

Creating a faction would require either an enumeration or plethora of variables. Depends on how you define a faction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)