pawn Код:
/* Player's Teleport system.
By [xB]Lordz.
Topic : https://sampforum.blast.hk/showthread.ph...pid2086387
Author: [xB]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.
//#define FILTERSCRIPT
*/#include <a_samp>#include <zcmd>#include <sscanf2>#if defined FILTERSCRIPTpublic OnFilterScriptInit
(){ print("\n--------------------------------------");
print(" Player's teleport system loaded.
print(" For GGTDM v9
");
print("--------------------------------------\n
");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
/*================================================= ================================================== =========
Player's Teleport system by [xB]Lordz.
================================================== ================================================== =========*/
#define red 0xFF0000
#define mtele
//Uncomment this to disable money goto(/mtele)
#define orange 0xFF9900AA
#define green 0x33FF33AA
new tele[MAX_PLAYERS];
CMD:tele(playerid,params[])
{
if(tele[playerid] == 0)
{
tele[playerid] = 1;
SendClientMessage(playerid, red, "[LB
]: You
've enabled tele command. Note that others can teleport to you.");
}
else if(tele[playerid] == 1)
{
tele[playerid] = 0;
SendClientMessage(playerid, red, "[LB]: Your tele command has been turned off.");
}
return 1;
}
CMD:teleon(playerid,params[])
{
if(tele[playerid] == 1) return SendClientMessage(playerid, red, "[LB]ERROR: You've already enabled tele command. Use
/teleoff.
");
tele[playerid] = 1;
SendClientMessage(playerid, red, "[LB
]: You
've enabled tele command. Note that others can teleport to you.");
return 1;
}
CMD:teleoff(playerid,params[])
{
if(tele[playerid] == 0) return SendClientMessage(playerid, red, "[LB]ERROR: Your tele command is already OFF. Use /teleon to enable.");
tele[playerid] = 0;
SendClientMessage(playerid, red, "[LB]: Your tele command has been turned off.");
return 1;
}
CMD:goto(playerid,params[])
{
new teleid;
if(sscanf(params,"u",teleid)) return SendClientMessage(playerid, red, "Usage:/ptele [playerid]");
// if(IsPlayerConnected(teleid)) return SendClientMessage(playerid, red, "Player is not connected");
if(tele[teleid]==0) return SendClientMessage(playerid, red, "Player has not enabled tele command, Please Ask his permission before using again!");
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, red, "[LB]ERROR: You need to have $550,000 to use this command.");
new target;
if(sscanf(params,"u",target)) return SendClientMessage(playerid, red, "Usage:/mtele [playerid]");
// if(IsPlayerConnected(target)) return SendClientMessage(playerid, red, "Player isnt connected");
GivePlayerMoney(playerid,-550000);
new Float,Float:y,Float:z,mint;
GetPlayerPos(target,x,y,z);
mint = GetPlayerInterior(target);
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,mint);
SendClientMessage(playerid, red, "[LB]: You've successfully used
/mtele using $
550,000.
");
return 1;
}
#endif
CMD:telecmds(playerid,params[])
{
SendClientMessage(playerid, orange, "=====================================");
SendClientMessage(playerid, green, "Server is scripted by
[LB
]Black_Devil
");
SendClientMessage(playerid, orange, "=====================================");
SendClientMessage(playerid, orange, "/teleon
[To enable tele command
]");
SendClientMessage(playerid, orange, "/teleoff
[To disable tele command
]");
SendClientMessage(playerid, orange, "/tele
[To toggle tele command
]");
SendClientMessage(playerid, orange, "/ptele
[To teleport to other player
if other has enabled tele.
]");
SendClientMessage(playerid, orange, "/mtele
[To teleport to other player by spending money
]");
return 1;
}