player teleport to admin
#1

// player tele to admin//////////////////////////////////////
dcmd_ptele(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You do not have permission to use this command");

static ID, Float:locx, Float:locy, Float:locz, inter;
if (sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must use /ptele [id]");
else
{
GetPlayerPos(playerid, locx, locy, locz);
inter = GetPlayerInterior(playerid);
SetPlayerInterior(ID, inter);
SetPlayerPos(ID, locx, locy+1, locz+1);
return 1;
}
}
//////////////////////////////////////////////////////////////////////////////

why wont it work, theres no errors
Reply
#2

pawn Код:
dcmd_ptele(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You do not have permission to use this command");

    new ID, Float:locx, Float:locy, Float:locz, inter;
    if (sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must use /ptele [id]");
    GetPlayerPos(playerid, locx, locy, locz);
    inter = GetPlayerInterior(playerid);
    SetPlayerInterior(ID, inter);
    SetPlayerPos(ID, locx, locy+1, locz+1);
    return 1;
}
Make sure you have the latest plugin version of sscanf.
Reply
#3

Try
pawn Код:
new ID;
instead of static and use pawn tags when you post a topic
Reply
#4

pawn Код:
dcmd_ptele(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) // checks if player is admin
        return SendClientMessage(playerid, 0xFF0000FF, "You do not have permission to use this command");

    static
        pID
    ;
   
    if (sscanf(params, "u", ID)) // checks parameters
        return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must use /ptele [id]");
       
    if(!IsPlaterConnected(ID)) // checks if player connected
        return SendClientMessage(playerid, 0xFF0000FF,"ERROR: Player not connected!");
       
    static
        Float:locx,
        Float:locy,
        Float:locz
    ;
   
    GetPlayerPos(playerid, locx, locy, locz); // get position
    SetPlayerInterior(ID, GetPlayerInterior(playerid)); // set player interior
    SetPlayerPos(ID, locx, locy, locz+1); // set player a pos.
    return 1;
}
Reply
#5

it still dosnt work nothing happens no matter what I type /ptele, /ptele [id] nothing
Reply
#6

It must work,did you try Psymetrix's version and what I said(he was faster than me :P)?If no,check if you have this in OnPlayerCommand:

pawn Код:
dcmd(ptele,5,cmdtext);
Reply
#7

it works now thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)