[FilterScript] [FS] My First Admin Teleport to Player Filterscript - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] My First Admin Teleport to Player Filterscript (
/showthread.php?tid=119360)
[FS] My First Admin Teleport to Player Filterscript -
adsy - 07.01.2010
This script should teleport to stand next to a player or join them in their vehicle if they are driving. Only works when logged in as RCON.
Код:
#define FILTERSCRIPT
#include <a_samp>
//The line below here should be just one line.
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//The line above here should be just one line.
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Miniature Teleport FilterScript Mark 1.01");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
//new string[256];
//new diename[MAX_PLAYER_NAME];
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
dcmd(tele, 4, cmdtext);
return 0;
}
dcmd_tele(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
new id;
new putmein;
id = strval(params);
if(id == 0) {
id = playerid;
}
if (IsPlayerConnected(id)) {
new Float:xpos;
new Float:ypos;
new Float:zpos;
GetPlayerPos(id, Float:xpos, Float:ypos, Float:zpos);
if(!IsPlayerInAnyVehicle(id)) {
SetPlayerPos(playerid, xpos+1, ypos, zpos);
}
else{
putmein = GetPlayerVehicleID(id);
PutPlayerInVehicle(playerid, putmein, 1);
}
}
}
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
for(new i; i < GetMaxPlayers(); i++)
{
if (IsPlayerConnected(i))
{
if (IsPlayerInAnyVehicle(i))
{
SetPlayerHealth(i, 0.0);
}
}
}
return 1;
}
Re: [FS] My First Admin Teleport to Player Filterscript -
HydraX - 07.01.2010
More info..??
Re: [FS] My First Admin Teleport to Player Filterscript -
adsy - 07.01.2010
what more is there to know. thats all it is.
Re: [FS] My First Admin Teleport to Player Filterscript -
wolfcock - 09.07.2010
Nice!