Guest User

Untitled

a guest
Jan 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. COMMAND:enter(playerid, params[])
  2. {
  3. new BusID, BusType;
  4.  
  5. if (GetPlayerVehicleSeat(playerid) == -1)
  6. {
  7. for (new BusSlot; BusSlot < MAX_BUSINESSPERPLAYER; BusSlot++)
  8. {
  9. BusID = APlayerData[playerid][Business][BusSlot];
  10.  
  11. if (BusID != 0)
  12. {
  13. if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
  14. {
  15. BusType = ABusinessData[BusID][BusinessType];
  16.  
  17. // Set the worldid so other players cannot see him anymore
  18. SetPlayerVirtualWorld(playerid, 2000 + BusID);
  19. // Set the player inside the interior of the business
  20. SetPlayerInterior(playerid, ABusinessInteriors[BusType][InteriorID]);
  21. // Set the position of the player at the spawn-location of the business's interior
  22. SetPlayerPos(playerid, ABusinessInteriors[BusType][IntX], ABusinessInteriors[BusType][IntY], ABusinessInteriors[BusType][IntZ]);
  23.  
  24. // Also set a tracking-variable to enable /busmenu to track in which business the player is
  25. APlayerData[playerid][CurrentBusiness] = BusID;
  26. // Also let the player know he can use /busmenu to control his business
  27. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}pouzij /busmenu pro nastaveni");
  28. }
  29. }
  30. }
  31. }
  32. return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment