Guest User

Untitled

a guest
Feb 2nd, 2012
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. // Created by Brightas 2012.02.01
  2. //Home, sethome fs.
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. #define LT_KALBA true //REIKSME jeigu false=Anglø kalba, jeigu True= Lietuviè kalba
  7.  
  8.  
  9. #if LT_KALBA == true
  10. #error Perskaityk instaliacija kvailá
  11. #else
  12. #error Read installation first dumpass
  13. #endif
  14.  
  15. //Global var:
  16. new
  17. Interior [ MAX_PLAYERS ],
  18. VirtualW [ MAX_PLAYERS ],
  19. Float:Coord [ MAX_PLAYERS ][ 3 ];//Home cordinates
  20.  
  21. //commands
  22. COMMAND:sethome( playerid, params[ ] )
  23. {
  24. #pragma unused params
  25. GetPlayerPos( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
  26. Interior [ playerid ] = GetPlayerInterior(playerid);
  27. VirtualW [ playerid ] = GetPlayerVirtualWorld(playerid);
  28. #if LT_KALBA == true
  29. SendClientMessage( playerid, -1, "Namai nustatyti, norëdami nusiteleportuoti prie jø naudokite /namai" );
  30. #else
  31. SendClientMessage( playerid, -1, "Home set. If you want to get back home use /home" );
  32. #endif
  33. return 1;
  34. }
  35.  
  36. COMMAND:home( playerid, params[ ] )
  37. {
  38. #pragma unused params
  39. if ( Coord[ playerid ][ 0 ] == 0 && Coord[ playerid ][ 1 ] == 0 && Coord[ playerid ][ 2 ] == 0 )
  40.  
  41. #if LT_KALBA == true
  42. SendClientMessage( playerid, -1, "Namai nëra nustatyti naudokite /sethome" );
  43. #else
  44. SendClientMessage( playerid, -1, "Home not set , use /nustatytinamus" );
  45. #endif
  46.  
  47. else
  48. {
  49. SetPlayerInterior(playerid, Interior [ playerid ]);
  50. SetPlayerVirtualWorld( playerid, VirtualW [ playerid ]);
  51. TelePlayerToCoord( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
  52. #if LT_KALBA == true
  53. SendClientMessage( playerid, -1, "Jûs nukeltas prie namø" );
  54. #else
  55. SendClientMessage( playerid, -1, "Teleporting to home..." );
  56. #endif
  57. }
  58. return 1;
  59. }
  60. COMMAND:namai( playerid, params [ ] )
  61. return cmd_home ( playerid, params );
  62. COMMAND:nustatytinamus( playerid, params [ ] )
  63. return cmd_sethome ( playerid, params );
  64.  
  65. stock TelePlayerToCoord( playerid, Float:x, Float:y, Float:z )//This function will teleport player to cordinates/Ði funkcija nuteleportuos þmogø á kordinates
  66. {
  67.  
  68. if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  69. SetVehiclePos( GetPlayerVehicleID( playerid ), x, y, z );
  70. else
  71. SetPlayerPos( playerid, x, y, z );
  72. }
Advertisement
Add Comment
Please, Sign In to add comment