Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ShivRp First Filterscript
- //Goto System , V1.0
- //This script allows you to teleport to other players provided their name/playerid.
- //Do anything with this script.
- //I thought this will be helpful for many newbie servers.
- //View this script topic here & also about tutorial how i made it!
- //You can give me suggestions...
- //Do anything other than removing credits! Add it in your gamemode..
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #if defined FILTERSCRIPT
- #define Red 0xFF0000FF
- #define Yellow 0xFFFF00AA
- #define Green 0x33AA33AA
- //dialog ids...
- #define GOTO 99987451
- //variables
- new GotoDisabled[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\nNow Loading ShivRP Goto System V1.0");
- print(" Goto System V1.0 By ShivRp");
- print("Loaded Successfully.\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\nUnloading ShivRP Goto System V1.0");
- print(" Goto System V1.0 By ShivRp");
- print("UnLoaded Successfully.\n");
- return 1;
- }
- #else
- main()
- {
- print("\nNow Loading ShivRP Goto System V1.0");
- print(" Goto System V1.0 By ShivRp");
- print("Loaded Successfully.\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- GotoDisabled[playerid] = 0;
- SendClientMessage(playerid,Green,"This server is using ShivRp filterscript. Goto System V1.0.");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- GotoDisabled[playerid] = 0;
- return 1;
- }
- CMD:gotocmds(playerid,params[])
- {
- ShowPlayerDialog(playerid, GOTO, DIALOG_STYLE_MSGBOX, "ShivRp Goto V1 CMDS", "/goto - Teleport to other players\n/tgoto - Toggle goto enable/disable.\n/gotocmds - View all ShivRp Goto CMDS.", "Ok", "");
- return 1;
- }
- CMD:tgoto(playerid,params[])//toggle goto. disable/enable.
- {
- if(IsPlayerConnected(playerid))
- {
- if(GotoDisabled[playerid] == 1)
- {
- GotoDisabled[playerid] = 0;
- GameTextForPlayer(playerid,"~b~You have ~r~enabled ~b~goto",2000,3);
- SendClientMessage(playerid,Green,"This server is using ShivRp filterscript. Goto System V1.0.");
- return 1;
- }
- else
- {
- GotoDisabled[playerid] = 1;
- GameTextForPlayer(playerid,"~b~You have ~r~disabled ~b~goto",2000,3);
- SendClientMessage(playerid,Green,"This server is using ShivRp filterscript. Goto System V1.0.");
- return 1;
- }
- }
- return 1;
- }
- CMD:goto(playerid,params[])//Our main cmd!
- {
- new ID;
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, Red, "USAGE: /goto [id/part of nick]");
- else if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, Red, "This player is offline or it is yourself");
- if(GotoDisabled[ID] == 1)
- {
- GameTextForPlayer(playerid,"~y~Player has disabled goto!",2000,3);
- return 1;
- }
- else
- {
- new Float:x, Float:y, Float:z;
- new name[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(ID, name2, sizeof(name2));
- GetPlayerPos(ID, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z+1);
- format(string,sizeof(string),"[INFO]%s has teleported to you (/goto).",name);
- SendClientMessage(ID,Yellow,string);
- format(string,sizeof(string),"[INFO]You have teleported to %s (/goto).",name2);
- SendClientMessage(playerid,Yellow,string);
- PlayerPlaySound(ID, 1150, 0.0, 0.0, 10.0);
- SendClientMessage(playerid,Green,"This server is using ShivRp filterscript. Goto System V1.0.");
- PlayerPlaySound(playerid, 1150, 0.0, 0.0, 10.0);
- SendClientMessage(ID,Green,"This server is using ShivRp filterscript. Goto System V1.0.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement