How to lock a car for everyone when a specific player is offline...
#2

Ok first the vehicle must be created, and identified as Peter_Johnsons vehicle.

So at the top of the gamemode..

pawn Код:
new PetersCar;
and with all the rest of the vehicles you have created.

pawn Код:
PetersCar = AddStaticVehicle(model, x, y, z, Zangle, colour1, colour2);//Peters car
Under OnPlayerSpawn add this..

LockedVehicles();


now anywhere in the script, outside of any callback.

pawn Код:
stock LockedVehicles()
{
   for(new i=0; i<MAX_PLAYERS; i++)
   {
      new plname[32];
      GetPlayerName(i, plname, 32);
     
      if(strcmp(plname, "Peter_Johnson", true)==0)
      {
         SetVehicleParamsForPlayer(PetersCar, i, 0, 0);//unlocked for Peter_Johnson
      }
      else
      {
         SetVehicleParamsForPlayer(PetersCar, i, 0, 1);//locked if the players name isnt Peter_Johnson
      }
   }
}
Theres a simple way of doing it.

But if you are wanting to have it so the player actually buys the vehicle, then its locked for them only, thats possible too. It would just take quite a bit more work.
Reply


Messages In This Thread
How to lock a car for everyone when a specific player is offline... - by introzen - 16.06.2009, 21:09
Re: How to lock a car for everyone when a specific player is offline... - by Outbreak - 16.06.2009, 22:05

Forum Jump:


Users browsing this thread: 2 Guest(s)