[FilterScript] M's Teleport System
#1

M's Teleport System

In-Game Usage
Dubble click a player from scoreboard (TAB) and you will teleport to him/her.

Download
Solidfiles


Source Code

PHP код:
#include <a_samp>
#define FILTERSCRIPT
public OnFilterScriptInit()
{
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    new 
Float:xFloat:yFloat:z;
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(
GetPlayerInterior(clickedplayerid) >= 1) return SendClientMessage(playerid0xFFFFFFFF"You can teleport to a player inside an interior with a vehicle");
        if(
clickedplayerid == playerid) return 0;
        new 
str[150], vehicleid GetPlayerVehicleID(playerid);
        
GetPlayerPos(clickedplayeridxyz);
        
SetVehiclePos(vehicleidxyz);
        
LinkVehicleToInterior(vehicleidGetPlayerInterior(clickedplayerid));
        
SetVehicleVirtualWorld(vehicleidGetPlayerVirtualWorld(clickedplayerid));
        
format(strsizeof(str),"You have teleported to %s(%d)"GetName(clickedplayerid), clickedplayerid);
        
SendClientMessage(playerid0xFFFFFFFFstr);
    }
    else
    {
        new 
str[150];
        
GetPlayerPos(clickedplayeridxyz);
        
SetPlayerPos(playeridxyz);
        
SetPlayerInterior(playeridGetPlayerInterior(clickedplayerid));
        
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(clickedplayerid));
        
format(strsizeof(str),"You have teleported to %s(%d)"GetName(clickedplayerid), clickedplayerid);
        
SendClientMessage(playerid0xFFFFFFFFstr);
    }
    return 
1;
}
stock GetName(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNamesizeof(Name));
    return 
Name;

Reply


Messages In This Thread
M's Click Teleport System - by Fancy - 05.08.2015, 08:45
Re: M's Teleport System - by SpikY_ - 05.08.2015, 09:00
Re: M's Teleport System - by LazyB0y - 05.08.2015, 11:37
Re: M's Teleport System - by Mariciuc223 - 05.08.2015, 12:28
Re: M's Teleport System - by Fancy - 05.08.2015, 12:30

Forum Jump:


Users browsing this thread: 2 Guest(s)