Jump to content

Recommended Posts

Posted

Salutare prieteni, am decis sa vă arăt o modalitate foarte simplă pentru a vă teleporta către jucatori prin TAB.

Sper să fie de folos!

 

Pentru început adăugăm în public OnPlayerClickPlayer(playerid, clickedplayerid, source):

new String[64], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
SetPVarInt(clickedplayerid, "Teleport", playerid);
format(String, sizeof(String), "%s vrea sa se teleporteze catre tine", Name);
ShowPlayerDialog(clickedplayerid, 1, DIALOG_STYLE_MSGBOX, "Teleport", String, "Da", "Nu");

Și rămâne să adăugăm în public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]):

//if(dialogid == 1)
//switch(dialogid)
//{
	case 1:
	{
		if(!response) return 1;
		new Float: Coord[3];
		GetPlayerPos(playerid, Coord[0], Coord[1], Coord[2]);
		SetPlayerPos(GetPVarInt(playerid,"Teleport"), Coord[0], Coord[1], Coord[2]);
		DeletePVar(playerid, "Teleport");
	}

În final primim:

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new String[54], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    SetPVarInt(clickedplayerid, "Teleport", playerid);
    format(String, sizeof(String), "%s vrea sa se teleporteze catre tine", Name);
    ShowPlayerDialog(clickedplayerid, 1, DIALOG_STYLE_MSGBOX, "Teleport", String, "Da", "Nu");
    return 1;
} 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case 1:
		{
			if(!response) return 1;
			new Float: Coord[3];
			GetPlayerPos(playerid, Coord[0], Coord[1], Coord[2]);
			SetPlayerPos(GetPVarInt(playerid,"Teleport"), Coord[0], Coord[1], Coord[2]);
			DeletePVar(playerid, "Teleport");
		}
	}
    return 1;
}

 

Posted (edited)

O sa va propun o metoda proprie legat de acest sistem

 

#define SendClientMessage SCM
#define playerid pi

public 
  OnPlayerClickPlayer(playerid, clickedplayerid, source) {
	
	new Float:x,
		Float:y,
  		Float:z; 
	
  	GetPlayerPos(clickedplayerid,x,y,z);
  
    SetPlayerPos(playerid,
  		x,y+5,z);
  
	SetPlayerInterior(playerid,
		GetPlayerInterior(clickedplayerid));
  
	SetPlayerVirtualWorld(playerid,
	GetPlayerVirtualWorld(clickedplayerid));
	SCM(pi, -1, 
  		!"Te-ai teleportat cu succes la acest jucator");
	return 1; }

 

 

 

Edited by Khain Developer

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.