Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Home filterscript by Sellize
- #define FILTERSCRIPT
- #include <a_samp>
- public OnFilterScriptInit()
- {
- print("Home by Sellize");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPVarInt(playerid, "hashome", 0);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/sethome", true))
- {
- new Float:x, Float:y, Float:z;
- SendClientMessage(playerid, 0x08BDC9FF, "Home set. Use /home to teleport back.");
- GetPlayerPos(playerid, x, y, z);
- SetPVarFloat(playerid, "xpos", x);
- SetPVarFloat(playerid, "ypos", y);
- SetPVarFloat(playerid, "zpos", z);
- SetPVarInt(playerid, "hashome", 1);
- return 1;
- }
- else if(!strcmp(cmdtext, "/home", true))
- {
- if(GetPVarInt(playerid, "hashome") == 1)
- {
- SendClientMessage(playerid, 0x08BDC9FF, "Teleported to home.");
- SetPlayerPos(playerid, GetPVarFloat(playerid, "xpos"), GetPVarFloat(playerid, "ypos"), GetPVarFloat(playerid, "zpos"));
- }
- else
- {
- SendClientMessage(playerid, 0x7F898AFF, "You need to set your home first, use /sethome.");
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment