Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Created by Brightas 2012.02.01
- //Home, sethome fs.
- #include <a_samp>
- #include <zcmd>
- #define LT_KALBA true //REIKSME jeigu false=Anglų kalba, jeigu True= Lietuvič kalba
- #if LT_KALBA == true
- #error Perskaityk instaliacija kvailį
- #else
- #error Read installation first dumpass
- #endif
- //Global var:
- new
- Interior [ MAX_PLAYERS ],
- VirtualW [ MAX_PLAYERS ],
- Float:Coord [ MAX_PLAYERS ][ 3 ];//Home cordinates
- //commands
- COMMAND:sethome( playerid, params[ ] )
- {
- #pragma unused params
- GetPlayerPos( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
- Interior [ playerid ] = GetPlayerInterior(playerid);
- VirtualW [ playerid ] = GetPlayerVirtualWorld(playerid);
- #if LT_KALBA == true
- SendClientMessage( playerid, -1, "Namai nustatyti, norėdami nusiteleportuoti prie jų naudokite /namai );
- #else
- SendClientMessage( playerid, -1, "Home set. If you want to get back home use /home" );
- #endif
- return 1;
- }
- COMMAND:home( playerid, params[ ] )
- {
- #pragma unused params
- if ( Coord[ playerid ][ 0 ] == 0 && Coord[ playerid ][ 1 ] == 0 && Coord[ playerid ][ 2 ] == 0 )
- #if LT_KALBA == true
- SendClientMessage( playerid, -1, "Namai nėra nustatyti naudokite /sethome" );
- #else
- SendClientMessage( playerid, -1, "Home not set , use /nustatytinamus" );
- #endif
- else
- {
- SetPlayerInterior(playerid, Interior [ playerid ]);
- SetPlayerVirtualWorld( playerid, VirtualW [ playerid ]);
- TelePlayerToCoord( playerid, Coord[ playerid ][ 0 ], Coord[ playerid ][ 1 ], Coord[ playerid ][ 2 ] );
- #if LT_KALBA == true
- SendClientMessage( playerid, -1, "Jūs nukeltas prie namų" );
- #else
- SendClientMessage( playerid, -1, "Teleporting to home..." );
- #endif
- }
- return 1;
- }
- COMMAND:namai( playerid, params [ ] )
- return cmd_home ( playerid, params );
- COMMAND:nustatytinamus( playerid, params [ ] )
- return cmd_sethome ( playerid, params );
- stock TelePlayerToCoord( playerid, Float:x, Float:y, Float:z )//This function will teleport player to cordinates/Ši funkcija nuteleportuos žmogų į kordinates
- {
- if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
- SetVehiclePos( GetPlayerVehicleID( playerid ), x, y, z );
- else
- SetPlayerPos( playerid, x, y, z );
- }
Advertisement
Add Comment
Please, Sign In to add comment