14.11.2012, 19:37
Hello there!
I am currently using this code for /go commands, which allows me to allow or not people that are trying to /go to me.
It seems like the /go works, but actually it doesn't allow me to disable it, even if it says "Your tele command has been turned off"
Have you got any suggestions for me? Or maybe another system!
Thanks!
I am currently using this code for /go commands, which allows me to allow or not people that are trying to /go to me.
pawn Код:
// Player's Teleport system.
// By Lordz™.
//Topic : https://sampforum.blast.hk/showthread.ph...pid2086387
//Author: Lordz™.
//Version:BETA v1
//Released Date: 29/08/2012
//How to use:?
//Use /teleon to enable tele command.
//Note that if you enable tele command,others will be able to teleport to you using /ptele
//teleoff to disable tele command.
//ptele to teleport to a player.
//Note that you can only teleport to other using ptele if other has enabled tele command.
//mtele to teleport to a player by spending money.
//telecmds to view commands.
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Player's teleport system loaded.");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
//============================================================================================================
//Player's Teleport system by Lordz™.
//=============================================================================================================*/
#define red 0xFF0000FF
#define COLOR_YELLOW 0xFFFF00AA
//#define mtele
//Uncomment this to disable money goto(/mtele)
#define orange 0xFF9900AA
#define green 0x33FF33AA
new tele[MAX_PLAYERS];
CMD:gon(playerid,params[])
{
if(tele[playerid]==1)
return SendClientMessage(playerid, COLOR_YELLOW, "You've already enabled GO command. Use /goff");
tele[playerid]=1;
SendClientMessage(playerid, COLOR_YELLOW, "You've enabled tele command. Note that others can teleport to you.");
return 1;
}
CMD:goff(playerid,params[])
{
if(tele[playerid]==0)
return SendClientMessage(playerid, COLOR_YELLOW, "You've already disabled GO command. Use /gon to enable.");
tele[playerid]=0;
SendClientMessage(playerid, COLOR_YELLOW, "Your tele command has been turned off.");
return 1;
}
CMD:go(playerid,params[])
{
new teleid;
if(sscanf(params,"u",teleid)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /go [playerid]");
// if(IsPlayerConnected(teleid)) return SendClientMessage(playerid, red, "Player is not connected");
if(tele[teleid]==1) return SendClientMessage(playerid, COLOR_YELLOW, "Player has disabled GO command..");
new Float:telex,Float:teley,Float:telez,int;
GetPlayerPos(teleid,telex,teley,telez);
int = GetPlayerInterior(teleid);
SetPlayerPos(playerid,telex,teley,telez);
SetPlayerInterior(playerid,int);
return 1;
}
#if defined mtele
CMD:mtele(playerid,params[])
{
if(GetPlayerMoney(playerid)<5000) return SendClientMessage(playerid, COLOR_YELLOW, "You need $5000 to use this command.");
new target;
if(sscanf(params,"u",target)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage:/mtele [playerid]");
// if(IsPlayerConnected(target)) return SendClientMessage(playerid, red, "Player isnt connected");
GivePlayerMoney(playerid,-5000);
new Float:x,Float:y,Float:z,mint;
GetPlayerPos(target,x,y,z);
mint = GetPlayerInterior(target);
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,mint);
SendClientMessage(playerid, red, "You've successfully used /mtele using $5000.");
return 1;
}
#endif
//Hope you will enjoy the script.
Have you got any suggestions for me? Or maybe another system!
Thanks!