Guest User

Untitled

a guest
Feb 1st, 2012
193
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. #if LT_KALBA == true
  9. #error Perskaityk instaliacija kvailį
  10. #else
  11. #error Read installation first dumpass
  12. #endif
  13.  
  14. //Global var:
  15. new
  16. Interior [ MAX_PLAYERS ],
  17. VirtualW [ MAX_PLAYERS ],
  18. Float:Coord [ MAX_PLAYERS ][ 3 ];//Home cordinates
  19.  
  20. //commands
  21. COMMAND:sethome( playerid, params[ ] )
  22. {
  23. #pragma unused params
  24. GetPlayerPos( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
  25. Interior [ playerid ] = GetPlayerInterior(playerid);
  26. VirtualW [ playerid ] = GetPlayerVirtualWorld(playerid);
  27. #if LT_KALBA == true
  28. SendClientMessage( playerid, -1, "Namai nustatyti, norėdami nusiteleportuoti prie jų naudokite /namai );
  29. #else
  30. SendClientMessage( playerid, -1, "Home set. If you want to get back home use /home" );
  31. #endif
  32. return 1;
  33. }
  34.  
  35. COMMAND:home( playerid, params[ ] )
  36. {
  37. #pragma unused params
  38. if ( Coord[ playerid ][ 0 ] == 0 && Coord[ playerid ][ 1 ] == 0 && Coord[ playerid ][ 2 ] == 0 )
  39.  
  40. #if LT_KALBA == true
  41. SendClientMessage( playerid, -1, "Namai nėra nustatyti naudokite /sethome" );
  42. #else
  43. SendClientMessage( playerid, -1, "Home not set , use /nustatytinamus" );
  44. #endif
  45.  
  46. else
  47. {
  48. SetPlayerInterior(playerid, Interior [ playerid ]);
  49. SetPlayerVirtualWorld( playerid, VirtualW [ playerid ]);
  50. TelePlayerToCoord( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
  51. #if LT_KALBA == true
  52. SendClientMessage( playerid, -1, "Jūs nukeltas prie namų" );
  53. #else
  54. SendClientMessage( playerid, -1, "Teleporting to home..." );
  55. #endif
  56. }
  57. return 1;
  58. }
  59. COMMAND:namai( playerid, params [ ] )
  60. return cmd_home ( playerid, params );
  61. COMMAND:nustatytinamus( playerid, params [ ] )
  62. return cmd_sethome ( playerid, params );
  63.  
  64. stock TelePlayerToCoord( playerid, Float:x, Float:y, Float:z )//This function will teleport player to cordinates/Ši funkcija nuteleportuos žmogų į kordinates
  65. {
  66.  
  67. if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  68. SetVehiclePos( GetPlayerVehicleID( playerid ), x, y, z );
  69. else
  70. SetPlayerPos( playerid, x, y, z );
  71. }
Advertisement
Add Comment
Please, Sign In to add comment