/ago command bug in virtualworld/interior
#1

When I use this /ago [playerid] It works and it teleports me right to the player (he's in derby that time), but I don't see anything except the player that I have teleported. No object... just a weird plain grey color...

Info: M

pawn Код:
dcmd_ago(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /ago [PlayerID]") &&
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Function: Will Go to specified player");
        new player1;
        new string[128];
        if(!IsNumeric(params))
        player1 = ReturnPlayerID(params);
        else player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
         {
            SendCommandToAdmins(playerid,"Ago");
            new Float:x, Float:y, Float:z;  GetPlayerPos(player1,x,y,z);
            SetPlayerInterior(playerid,GetPlayerInterior(player1));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
            if(GetPlayerState(playerid) == 2)
            {
            SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            }
            else SetPlayerPos(playerid,x+2,y,z);
            format(string,sizeof(string),"You have Teleported to %s ", pName(player1));
            return SendClientMessage(playerid,BlueMsg,string);
        }
        else return ErrorMessages(playerid, 4);
    }
    else return ErrorMessages(playerid, 1);
}
Reply
#2

Make sure you've it set, so when you teleport it sets your VW and INT ID - To the designed player you've teleported to.
Reply
#3

Quote:
Originally Posted by Akira297
Посмотреть сообщение
Make sure you've it set, so when you teleport it sets your VW and INT ID - To the designed player you've teleported to.
Yes I did. Also I have this /go command for normal player it works fine. No problems at all don't like /ago.

pawn Код:
cmd:ago(playerid, params[])
{
    if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
    {
        new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
        if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");//checks if you have written something after /goto if no it sends error
        if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
        new Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME], str[64], i, vw; //creates new variables to store floats, strings and values
        GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
        i = GetPlayerInterior(ID);
        vw = GetPlayerVirtualWorld(ID);
        if(i) SetPlayerInterior(playerid, i);
        if(vw) SetPlayerVirtualWorld(playerid, vw);
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(i)
            {
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), i);
                DestroyVehicle(GetPlayerVehicleID(playerid));
            }
            if(vw) SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), vw);
            SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
        }
        else SetPlayerPos(playerid, x + 1, y + 1, z + 1);
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
        SendClientMessage(ID, 0xFFFFFFFF, str);
        return 1;
        }
        else return ErrorMessages(playerid, 4);
    }
    else return ErrorMessages(playerid, 1);
}
}
Reply
#4

Can someone convert this to zcmd? Above...
Reply
#5

Quote:
Originally Posted by kbalor
Посмотреть сообщение
Can someone convert this to zcmd? Above...
Reply
#6

This may work, give a try.

pawn Код:
CMD:ago(playerid, params[])
{
    if(AccInfo[playerid][Level] <= 2 && !IsPlayerAdmin(playerid)) return ErrorMessages(playerid, 1);
    new ID;
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");
    if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
    new Float:x, Float:y, Float:z,name[25],i = GetPlayerVehicleID(playerid),str[128];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    GetPlayerPos(ID, x, y, z);
    if(IsPlayerInAnyVehicle(playerid)) {
        LinkVehicleToInterior(i,GetPlayerInterior(ID));
        SetVehicleVirtualWorld(i,GetPlayerVirtualWorld(ID));
        SetVehiclePos(i, x + 1, y + 1, z);
        PutPlayerInVehicle(playerid,i, 0);
        format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
        return SendClientMessage(ID, 0xFFFFFFFF, str);
    }
    SetPlayerPos(playerid, x + 1, y + 1, z + 1);
    format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
    return SendClientMessage(ID, 0xFFFFFFFF, str);
}
Reply
#7

Quote:
Originally Posted by Julian12345
Посмотреть сообщение
yes pal u muste stp thinket you are so lazy ... ffs
Reply
#8

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
This may work, give a try.

pawn Код:
CMD:ago(playerid, params[])
{
    if(AccInfo[playerid][Level] <= 2 && !IsPlayerAdmin(playerid)) return ErrorMessages(playerid, 1);
    new ID;
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");
    if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
    new Float:x, Float:y, Float:z,name[25],i = GetPlayerVehicleID(playerid),str[128];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    GetPlayerPos(ID, x, y, z);
    if(IsPlayerInAnyVehicle(playerid)) {
        LinkVehicleToInterior(i,GetPlayerInterior(ID));
        SetVehicleVirtualWorld(i,GetPlayerVirtualWorld(ID));
        SetVehiclePos(i, x + 1, y + 1, z);
        PutPlayerInVehicle(playerid,i, 0);
        format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
        return SendClientMessage(ID, 0xFFFFFFFF, str);
    }
    SetPlayerPos(playerid, x + 1, y + 1, z + 1);
    format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
    return SendClientMessage(ID, 0xFFFFFFFF, str);
}
Thanks leopard.. This would not work coz its cmd: i need is dcmd_ to work. im using luxadmin. Thanks!
Reply
#9

Quote:
Originally Posted by kbalor
Посмотреть сообщение
Can someone convert this to zcmd?
ungrateful, next time i won't help.

and my nick is LEONARDO1434.
Reply
#10

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
ungrateful, next time i won't help.

and my nick is LEONARDO1434.
Im sorry leonardo doesn't mean i have many post. I'm good in scripting. You know people have mistakes..
And I don't know much about zcmd. It's just the luxadmin filterscript that uses zcmd processor. I know your a good person you've always helped me alot than other. I just need the zcmd for /ago
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)