Jump to content

N1kS

Membru
  • Posts

    10
  • Joined

  • Last visited

Posts posted by N1kS

  1. 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;
    }

     

×
×
  • 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.