Command problem ! [+REP]
#1

pawn Код:
CMD:get(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new player1;
        if(SendTele[player1] == 0)
        {
            gsString[0] = EOS;
        //----------------------------------------------------------------------
            if(sscanf(params, "u", player1)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /get [PlayerID]") &&
            SendClientMessage(playerid, orange, "Function: Will get to you the specified player");
        //----------------------------------------------------------------------
            if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return
            SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        //----------------------------------------------------------------------
            if(AccInfo[player1][IgnGet] == 1 && AccInfo[playerid][Level] != 10) return
            SendClientMessage(playerid, red, "ERROR: This player has Ignore Get activated!");
        //----------------------------------------------------------------------
            if(GetPVarInt(player1, "PlayerInDM") == 1 || GetPVarInt(player1, "PlayerInLMS") == 1 || GetPVarInt(player1, "PlayerInJob") == 1 || GetPVarInt(player1, "PlayerInHNSS") == 1 || GetPVarInt(player1, "PlayerInDerby") == 1 || GetPVarInt(player1, "PlayerInMaze") == 1) return
            SendClientMessage(playerid, red, "ERROR: You cannot teleport this player to your position while he is in a DM Zone!");
        //----------------------------------------------------------------------
            if(IsPlayerConnected(player1))
            {
            //------------------------------------------------------------------
                if(player1 == playerid) return
                SendClientMessage(playerid, red, "ERROR: You cannot teleport to yourself!");
                SendTele[player1] = 1;
                Teleporter[playerid] = playerid;
                format(gsString, sizeof(gsString), "Administrator %s wants to teleport to his location type /accept or /decline", PlayerName2(Teleporter[playerid]));
                SendClientMessage(player1, blue, gsString);
                return 1;
            }
            else return SendClientMessage(playerid, red, "ERROR: Player not Connected!");
        }
        else return SendClientMessage(playerid, red, "ERROR: This player is already getted by other person!");
    }
    else return SendClientMessage(playerid, red, "ERROR: You must be Level 3 to use this command!");
}
CMD:accept(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
            new string[128], VehicleID, Float:x, Float:y, Float:z;
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            GetPlayerPos(Teleporter[playerid], x,y,z);
            SendCommandToAdmins(Teleporter[playerid], "Get");
            SetPlayerInterior(playerid, GetPlayerInterior(Teleporter[playerid]));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Teleporter[playerid]));
            //------------------------------------------------------------------
            if(GetPlayerState(playerid) == 2)
            {
                VehicleID = GetPlayerVehicleID(playerid);
                SetVehiclePos(VehicleID, x+2,y,z);
                LinkVehicleToInterior(VehicleID, GetPlayerInterior(Teleporter[playerid]));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Teleporter[playerid]));
                SendTele[playerid] = 0;
            }
            else
            {
                SetPlayerPos(playerid, x+3,y,z);
                SendTele[playerid] = 0;
            }
            //------------------------------------------------------------------
            format(string,sizeof(string),"|- You have been Teleported to Administrator \"%s's\" position! -|", PlayerName2(Teleporter[playerid]));
            SendClientMessage(playerid,blue,string);
            format(string,sizeof(string),"|- You have Teleported \"%s\" to your Position -|", PlayerName2(playerid));
            SendClientMessage(playerid,BlueMsg,string);
            return 1;
    }
    else return SendClientMessage(playerid, blue, "You don't have any get request to teleport!");
}
CMD:decline(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
        gsString[0] = EOS;
        SendTele[playerid] = 0;
        format(gsString, sizeof(gsString), "%s has declined your teleport get", PlayerName2(playerid));
        SendClientMessage(Teleporter[playerid], blue, gsString);
        return 1;
    }
    else return SendClientMessage(playerid, -1,"{FF0000}You don't have any teleport request");
}
So when a admin / vip types /get x , to x shows "Administrator x wants to teleport to his location type /accept bla bla "
All works fine but when the player x type /accept , does not teleport to the Administrator position why ?
I can't find what is wrng .
Please help me +REP!
Reply
#2

you want a cmd for admins to tp others ? or u want a cmd to when a player accepts tp to him?
Reply
#3

i want when a admin type /get x , to the player x show administrator x wants to teleport bla bla type /accept
When player x type /accept teleport to x administrator
And if he type /decline don't teleport.
The problem is when the player type /accept doesn't teleport to the administrator
What is wrong ?
Reply
#4

pawn Код:
CMD:get(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new player1;
        if(SendTele[player1] == 0)
        {
            gsString[0] = EOS;
        //----------------------------------------------------------------------
            if(sscanf(params, "u", player1)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /get [PlayerID]") &&
            SendClientMessage(playerid, orange, "Function: Will get to you the specified player");
        //----------------------------------------------------------------------
            if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return
            SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        //----------------------------------------------------------------------
            if(AccInfo[player1][IgnGet] == 1 && AccInfo[playerid][Level] != 10) return
            SendClientMessage(playerid, red, "ERROR: This player has Ignore Get activated!");
        //----------------------------------------------------------------------
            if(GetPVarInt(player1, "PlayerInDM") == 1 || GetPVarInt(player1, "PlayerInLMS") == 1 || GetPVarInt(player1, "PlayerInJob") == 1 || GetPVarInt(player1, "PlayerInHNSS") == 1 || GetPVarInt(player1, "PlayerInDerby") == 1 || GetPVarInt(player1, "PlayerInMaze") == 1) return
            SendClientMessage(playerid, red, "ERROR: You cannot teleport this player to your position while he is in a DM Zone!");
        //----------------------------------------------------------------------
            if(IsPlayerConnected(player1))
            {
            //------------------------------------------------------------------
                if(player1 == playerid) return
                SendClientMessage(playerid, red, "ERROR: You cannot teleport to yourself!");
                SendTele[player1] = 1;
                Teleporter[playerid] = playerid;
                format(gsString, sizeof(gsString), "Administrator %s wants to teleport to his location type /accept or /decline", PlayerName2(Teleporter[playerid]));
                SendClientMessage(player1, blue, gsString);
                return 1;
            }
            else return SendClientMessage(playerid, red, "ERROR: Player not Connected!");
        }
        else return SendClientMessage(playerid, red, "ERROR: This player is already getted by other person!");
    }
    else return SendClientMessage(playerid, red, "ERROR: You must be Level 3 to use this command!");
}
CMD:accept(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
            new
            string[128],targetid,Float:Pos[3];
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            GetPlayerPos(targetid,Pos[0],Pos[1],Pos[2]);
            SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid,GetPlayerInterior(targetid));
            SendCommandToAdmins(Teleporter[playerid], "Get");
            SetPlayerInterior(playerid, GetPlayerInterior(Teleporter[playerid]));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Teleporter[playerid]));
            //------------------------------------------------------------------
            if(GetPlayerState(playerid) == 2)
            {
                VehicleID = GetPlayerVehicleID(playerid);
                SetVehiclePos(VehicleID, x+2,y,z);
                LinkVehicleToInterior(VehicleID, GetPlayerInterior(Teleporter[playerid]));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Teleporter[playerid]));
                SendTele[playerid] = 0;
            }
            else
            {
                SetPlayerPos(playerid, x+3,y,z);
                SendTele[playerid] = 0;
            }
            //------------------------------------------------------------------
            format(string,sizeof(string),"|- You have been Teleported to Administrator \"%s's\" position! -|", PlayerName2(Teleporter[playerid]));
            SendClientMessage(playerid,blue,string);
            format(string,sizeof(string),"|- You have Teleported \"%s\" to your Position -|", PlayerName2(playerid));
            SendClientMessage(playerid,BlueMsg,string);
            return 1;
    }
    else return SendClientMessage(playerid, blue, "You don't have any get request to teleport!");
}
CMD:decline(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
        gsString[0] = EOS;
        SendTele[playerid] = 0;
        format(gsString, sizeof(gsString), "%s has declined your teleport get", PlayerName2(playerid));
        SendClientMessage(Teleporter[playerid], blue, gsString);
        return 1;
    }
    else return SendClientMessage(playerid, -1,"{FF0000}You don't have any teleport request");
}
I Hope this help u
EDIT:if it didnt tell me i will give u a /get CMD that admin gets the player to him
Reply
#5

if u don't see in /get cmd i have putted "Teleporter[playerid] = playerid;- Administrators id", and in /accept cmd i have putted : GetPlayerPos(Teleporter[playerid], x , y , z);
and SetPlayerPos(playerid, x, y , z);" why do u give me targetid and many others which i already have ...
Doesn't help me and i don't need a new command just to say me whats' wrong with me command
Reply
#6

Please help me , sorry for 2 x post but i need very fast .
Reply
#7

pawn Код:
CMD:get(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new player1;
        if (sscanf(params, "u", player1)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/get <playerid>\"");
    else if (player1 == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
        if(SendTele[player1] == 0)
        {
            gsString[0] = EOS;
        //----------------------------------------------------------------------
            if(sscanf(params, "u", player1)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /get [PlayerID]") &&
            SendClientMessage(playerid, orange, "Function: Will get to you the specified player");
        //----------------------------------------------------------------------
            if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return
            SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        //----------------------------------------------------------------------
            if(AccInfo[player1][IgnGet] == 1 && AccInfo[playerid][Level] != 10) return
            SendClientMessage(playerid, red, "ERROR: This player has Ignore Get activated!");
        //----------------------------------------------------------------------
            if(GetPVarInt(player1, "PlayerInDM") == 1 || GetPVarInt(player1, "PlayerInLMS") == 1 || GetPVarInt(player1, "PlayerInJob") == 1 || GetPVarInt(player1, "PlayerInHNSS") == 1 || GetPVarInt(player1, "PlayerInDerby") == 1 || GetPVarInt(player1, "PlayerInMaze") == 1) return
            SendClientMessage(playerid, red, "ERROR: You cannot teleport this player to your position while he is in a DM Zone!");
        //----------------------------------------------------------------------
            if(IsPlayerConnected(player1))
            {
            //------------------------------------------------------------------
                if(player1 == playerid) return
                SendClientMessage(playerid, red, "ERROR: You cannot teleport to yourself!");
                SendTele[player1] = 1;
                Teleporter[playerid] = playerid;
                format(gsString, sizeof(gsString), "Administrator %s wants to teleport to his location type /accept or /decline", PlayerName2(Teleporter[playerid]));
                SendClientMessage(player1, blue, gsString);
                return 1;
            }
            else return SendClientMessage(playerid, red, "ERROR: Player not Connected!");
        }
        else return SendClientMessage(playerid, red, "ERROR: This player is already getted by other person!");
    }
    else return SendClientMessage(playerid, red, "ERROR: You must be Level 3 to use this command!");
}
CMD:accept(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
            new string[128], VehicleID, Float:x, Float:y, Float:z;
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            GetPlayerPos(Teleporter[playerid], x,y,z);
            SendCommandToAdmins(Teleporter[playerid], "Get");
            SetPlayerInterior(playerid, GetPlayerInterior(Teleporter[playerid]));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Teleporter[playerid]));
            //------------------------------------------------------------------
            if(GetPlayerState(playerid) == 2)
            {
                VehicleID = GetPlayerVehicleID(playerid);
                SetVehiclePos(VehicleID, x+2,y,z);
                LinkVehicleToInterior(VehicleID, GetPlayerInterior(Teleporter[playerid]));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Teleporter[playerid]));
                SendTele[playerid] = 0;
            }
            else
            {
                SetPlayerPos(playerid, x+3,y,z);
                SendTele[playerid] = 0;
            }
            //------------------------------------------------------------------
            format(string,sizeof(string),"|- You have been Teleported to Administrator \"%s's\" position! -|", PlayerName2(Teleporter[playerid]));
            SendClientMessage(playerid,blue,string);
            format(string,sizeof(string),"|- You have Teleported \"%s\" to your Position -|", PlayerName2(playerid));
            SendClientMessage(playerid,BlueMsg,string);
            return 1;
    }
    else return SendClientMessage(playerid, blue, "You don't have any get request to teleport!");
}
CMD:decline(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
        gsString[0] = EOS;
        SendTele[playerid] = 0;
        format(gsString, sizeof(gsString), "%s has declined your teleport get", PlayerName2(playerid));
        SendClientMessage(Teleporter[playerid], blue, gsString);
        return 1;
    }
    else return SendClientMessage(playerid, -1,"{FF0000}You don't have any teleport request");
}
Reply
#8

Guys the problem is at /accept command doesn't teleport to administrator and projectman look careful
pawn Код:
if(IsPlayerConnected(player1))
            {
            //------------------------------------------------------------------
                if(player1 == playerid) return
                SendClientMessage(playerid, red, "ERROR: You cannot teleport to yourself!");
                SendTele[player1] = 1;
                Teleporter[playerid] = playerid;
                format(gsString, sizeof(gsString), "Administrator %s wants to teleport to his location type /accept or /decline", PlayerName2(Teleporter[playerid]));
                SendClientMessage(player1, blue, gsString);
                return 1;
            }
I already make this.
Reply
#9

In All The Commands And In: new Teleporter[MAX_PLAYERS]; delete [MAX_PLAYERS] and in the commands delete the [playerid(oranythinghere] near it
Reply
#10

pawn Код:
CMD:get(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new player1;
        if (sscanf(params, "u", player1)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/get <playerid>\"");
    else if (player1 == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
        if(SendTele[player1] == 0)
        {
            gsString[0] = EOS;
        //----------------------------------------------------------------------
            if(sscanf(params, "u", player1)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /get [PlayerID]") &&
            SendClientMessage(playerid, orange, "Function: Will get to you the specified player");
        //----------------------------------------------------------------------
            if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return
            SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        //----------------------------------------------------------------------
            if(AccInfo[player1][IgnGet] == 1 && AccInfo[playerid][Level] != 10) return
            SendClientMessage(playerid, red, "ERROR: This player has Ignore Get activated!");
        //----------------------------------------------------------------------
            if(GetPVarInt(player1, "PlayerInDM") == 1 || GetPVarInt(player1, "PlayerInLMS") == 1 || GetPVarInt(player1, "PlayerInJob") == 1 || GetPVarInt(player1, "PlayerInHNSS") == 1 || GetPVarInt(player1, "PlayerInDerby") == 1 || GetPVarInt(player1, "PlayerInMaze") == 1) return
            SendClientMessage(playerid, red, "ERROR: You cannot teleport this player to your position while he is in a DM Zone!");
        //----------------------------------------------------------------------
            if(IsPlayerConnected(player1))
            {
            //------------------------------------------------------------------
                if(player1 == playerid) return
                SendClientMessage(playerid, red, "ERROR: You cannot teleport to yourself!");
                SendTele[player1] = 1;
                Teleporter[player1] = playerid;
                format(gsString, sizeof(gsString), "Administrator %s wants to teleport to his location type /accept or /decline", PlayerName2(Teleporter[player1]));
                SendClientMessage(player1, blue, gsString);
                return 1;
            }
            else return SendClientMessage(playerid, red, "ERROR: Player not Connected!");
        }
        else return SendClientMessage(playerid, red, "ERROR: This player is already getted by other person!");
    }
    else return SendClientMessage(playerid, red, "ERROR: You must be Level 3 to use this command!");
}
CMD:accept(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
            new string[128], VehicleID, Float:x, Float:y, Float:z;
            //------------------------------------------------------------------
            //------------------------------------------------------------------
            GetPlayerPos(Teleporter[playerid], x,y,z);
            SendCommandToAdmins(Teleporter[playerid], "Get");
            SetPlayerInterior(playerid, GetPlayerInterior(Teleporter[playerid]));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Teleporter[playerid]));
            //------------------------------------------------------------------
            if(GetPlayerState(playerid) == 2)
            {
                VehicleID = GetPlayerVehicleID(playerid);
                SetVehiclePos(VehicleID, x+2,y,z);
                LinkVehicleToInterior(VehicleID, GetPlayerInterior(Teleporter[playerid]));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Teleporter[playerid]));
                SendTele[playerid] = 0;
            }
            else
            {
                SetPlayerPos(playerid, x+3,y,z);
                SendTele[playerid] = 0;
            }
            //------------------------------------------------------------------
            format(string,sizeof(string),"|- You have been Teleported to Administrator \"%s's\" position! -|", PlayerName2(Teleporter[playerid]));
            SendClientMessage(playerid,blue,string);
            format(string,sizeof(string),"|- You have Teleported \"%s\" to your Position -|", PlayerName2(playerid));
            SendClientMessage(playerid,BlueMsg,string);
            return 1;
    }
    else return SendClientMessage(playerid, blue, "You don't have any get request to teleport!");
}
CMD:decline(playerid, params[])
{
    if(SendTele[playerid] == 1)
    {
        gsString[0] = EOS;
        SendTele[playerid] = 0;
        format(gsString, sizeof(gsString), "%s has declined your teleport get", PlayerName2(playerid));
        SendClientMessage(Teleporter[playerid], blue, gsString);
        return 1;
    }
    else return SendClientMessage(playerid, -1,"{FF0000}You don't have any teleport request");
}
Full fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)