need a "command"
#1

how can i make when i click on button [Tab] so it shows me a menu of all player and if i cllick on some player its teleports me to him
Please help me!
[cmd only for admins level 5]
Reply
#2

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new targetid;
    if(targetid != INVALID_PLAYER_ID)
   {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);
                SetPlayerPos(playerid, x, y, z);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
        SetPlayerInterior(playerid, GetPlayerInterior(targetid));
    }
    else return SendClientMessage(playerid, 0xFFAA00, "ERROR: invalid playerid");
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Avi Raj
Посмотреть сообщение
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new targetid;
    if(targetid != INVALID_PLAYER_ID)
   {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(targetid, x, y, z);
                SetPlayerPos(playerid, x, y, z);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
        SetPlayerInterior(playerid, GetPlayerInterior(targetid));
    }
    else return SendClientMessage(playerid, 0xFFAA00, "ERROR: invalid playerid");
    }
    return 1;
}
Error :
Quote:

C:\Users\xxxxx\Desktop\Ross County RP(3)\Ross County RP\gamemodes\rc.pwn(1285 : warning 217: loose indentation
C:\Users\xxxxx\Desktop\Ross County RP(3)\Ross County RP\gamemodes\rc.pwn(12859) : warning 217: loose indentation
C:\Users\xxxxx\Desktop\Ross County RP(3)\Ross County RP\gamemodes\rc.pwn(12863) : warning 209: function "S@@_OnPlayerClickPlayer" should return a value
C:\Users\xxxxx\Desktop\Ross County RP(3)\Ross County RP\gamemodes\rc.pwn(12864) : error 010: invalid function or declaration
C:\Users\xxxxx\Desktop\Ross County RP(3)\Ross County RP\gamemodes\rc.pwn(31405) : error 021: symbol already defined: "S@@_OnPlayerClickPlayer"

Reply
#4

The code Avi Raj posted won't work.

Insert this code into the OnPlayerClickPlayer callback which you already have in your script:

pawn Код:
if(----- YOUR ADMIN VARIABLE ----- >= 5)
{
    new Float: playersPosition[3];

    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(clickedplayerid));
    SetPlayerInterior(playerid, GetPlayerInterior(clickedplayerid));

    GetPlayerPos(clickedplayerid, playersPosition[0], playersPosition[1], playersPosition[2]);
    SetPlayerPos(playerid, playersPosition[0], playersPosition[1], playersPosition[2]);
}
Replace ----- YOUR ADMIN VARIABLE ----- with your actual admin variable which is commonly PlayerInfo[playerid][pAdmin], but can differ among scripts.
Reply
#5

well i also needed the same thing but its kinda easy now.. i know how to do that but you need to tell if you are using ZCMD or something..
Reply
#6

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
The code Avi Raj posted won't work.

Insert this code into the OnPlayerClickPlayer callback which you already have in your script:

pawn Код:
if(----- YOUR ADMIN VARIABLE ----- >= 5)
{
    new Float: playersPosition[3];

    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(clickedplayerid));
    SetPlayerInterior(playerid, GetPlayerInterior(clickedplayerid));

    GetPlayerPos(clickedplayerid, playersPosition[0], playersPosition[1], playersPosition[2]);
    SetPlayerPos(playerid, playersPosition[0], playersPosition[1], playersPosition[2]);
}
Replace ----- YOUR ADMIN VARIABLE ----- with your actual admin variable which is commonly PlayerInfo[playerid][pAdmin], but can differ among scripts.
can you please make it like : "FileScript" Ty!!
Reply
#7

help me please
Reply
#8

Quote:
Originally Posted by Toxykx
Посмотреть сообщение
can you please make it like : "FileScript" Ty!!
he already told you to add it under OnPlayerClickPlayer in your game mode, so you don't and won't need any filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)