#1

Im making a rp server,..

But theres a problem.

I dont know how to add faction cars

that only people in the faction can use them.

Does anyone knows how to do this?



Thank you
Reply
#2

you need a variable for cars like..
pawn Код:
new isFactionVehilce[701]; // 701 and id 0 won't be used
and you do isFactionVehicle[vehicleid] = 1; // do this when you add the vehicle. example:
pawn Код:
/*OnGameModeInit*/
new car = CreateVehicle(/*parameters here*/);
isFactionVehicle[car] = 1;
now all that is left is do a check.
pawn Код:
/*OnPlayerStateChange*/
if(newstate == PLAYER_STATE_DRIVER)
{
if(isFactionVehicle[GetPlayerVehicleID(playerid)])
{
SendClientMessage(playerid, 0xFFFFFFFF/*or any other color*/, "You may not drive this vehicle!");
RemovePlayerFromVehicle(playerid);
}
}
of course you may set the value isFactionVehicle to the id of the team/faction and check if player's team is equa to the faction and if that's the case don't remove him. uh... you should do it that way. this is just an example


USE SEARCH, B****!!
Reply
#3

Hah,i did not understand



B****
Reply
#4

:P
well If you did not then I cannot help you any further. Use search and may the force be iwth you.... Always!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)