[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
#2

Nice one.
Reply
#3

Good JoB!
Reply
#4

Why do you use stock "GetName" ? You can simple get player name in OnPlayerClickPlayer ..
Reply
#5

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Why do you use stock "GetName" ? You can simple get player name in OnPlayerClickPlayer ..
Stocks make it quicker to script in big scripts.As you are new to scripting so you dont know everything
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)