Jump to content
  • 0

pomoc Jak zamknout vozidlo pro hráče


Vidie

Dotaz

3 odpovědí na tuto otázku

Recommended Posts

  • 0
COMMAND:lock(playerid)
{
   if(IsPlayerInAnyVehicle(playerid))
   {
  	 if(PlayerInfo[playerid][LockedVehicle] != GetPlayerVehicleID(playerid))
  	 {
            for(new i = 0; i < MAX_PLAYERS; i ++)
             {
                 if(i == playerid) continue;
                  SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);
                  if(PlayerInfo[playerid][LockedVehicle] != INVALID_VEHICLE_ID)
                  {
                      SetVehicleParamsForPlayer(PlayerInfo[playerid][LockedVehicle], i, 0, 0);
               }
           }
           PlayerInfo[playerid][LockedVehicle] = GetPlayerVehicleID(playerid);
           SendClientMessage(playerid, -1, ""COL_GREEN"Vozidlo bylo zamknuto.");
       } else {
           SendClientMessage(playerid, -1, ""COL_RED"Vozidlo už je zamknuto.");
       }
   } else {
       SendClientMessage(playerid, -1, ""COL_RED"Musíte být ve vozidle.");
   }
   return 1;
}

Link to comment
Share on other sites

  • 0

Záleží, jak to chceš mít. jestli se jedná třeba o auto u domu, řešil bych to přes nick. No a jestli to chceš přes proměnnou, tak nebudeš nastavovat u proměnné hodnoty 0,1 ale přímo ID hráče.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...