[Ajuda] comando /espiar e /ir
#1

Alguem pode me ajudar meu comando /espiar e /ir apartir do id 8 quando eu do ex: /ir 8 ele vai no id 0 mesma coisa com /espiar

COMANDOS:
Quote:

COMMAND:espiar(playerid, params[])
{
// Setup local variables
new OtherPlayer, Name[24], Msg[128];

// Send the command to all admins so they can see it
SendAdminText(playerid, "/espiar", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /espiar [id]");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the player's name
GetPlayerName(OtherPlayer, Name, sizeof(Name));

// Turn spectating on
TogglePlayerSpectating(playerid, 1);

// Check if the other player is driving a vehicle
if (GetPlayerVehicleSeat(OtherPlayer) == -1)
{
// The other player is on foot, so spectate him
PlayerSpectatePlayer(playerid, OtherPlayer);
SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
APlayerData[playerid][SpectateID] = OtherPlayer;
APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
}
else
{
// The other player is in a vehicle, so spectate the vehicle
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer));
APlayerData[playerid][SpectateID] = OtherPlayer;
APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer);
APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
}

format(Msg, 128, "{00FF00}[MDC] Vocк estб espiando {FFFF00}%s.", Name);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Esse jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}

Quote:

COMMAND:ir(playerid, params[])
{
// Setup local variables
new OtherPlayer, Float, Float:y, Float:z, PortMsg[128], IntID, WorldID;

// Send the command to all admins so they can see it
SendAdminText(playerid, "/ir", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
// Check if the player has a wanted level of less than 3
if (GetPlayerWantedLevel(playerid) < 3)
{
// Check if the player is not jailed
if (APlayerData[playerid][PlayerJailed] == 0)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /ir [id]");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the location of the other player
GetPlayerPos(OtherPlayer, x, y, z);
IntID = GetPlayerInterior(OtherPlayer);
WorldID = GetPlayerVirtualWorld(OtherPlayer);
// Port the player to the given location
SetPlayerVirtualWorld(playerid, WorldID);
SetPlayerInterior(playerid, IntID);
SetPlayerPos(playerid, x, y, z + 3.0);
// Let the player know about it
format(PortMsg, 128, "[MDC] A posiзгo do jogador й: %4.2f, %4.2f, %4.2f", x, y, z + 3.0);
SendClientMessage(playerid, 0x00FF00FF, PortMsg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "[MDC] Esse jogador nгo estб online.");
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Vocк nгo pode usar o comando /ir quando preso.");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Vocк nao pode usar o comando /ir quando procurado.");
}
else
return 0;
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}

Reply
#2

Isso й bug de sscanf, nгo dos comandos.
Provavelmente todos os comandos que usam ids estгo bugados (/mp, /trazer, /relato...)
Reply
#3

Eu tentei mudar o plugin sscanf mas parou de funcionar o sistema de login registro
Reply
#4

Tem que trocar o plugin e atualizar as includes. (e compilar o gamemode)
Reply
#5

eu fiz tudo isso mesmo assim nao deu certo
Reply
#6

Troca o argumento que tem a letra u para d

Quote:

sscanf(params, "u", OtherPlayer)...

para
Код:
sscanf(params, "d", OtherPlayer)
De todos os lugares que usa SSCANF e vк o resultado
Reply
#7

@Edit Nгo deu certo
Reply
#8

pawn Код:
COMMAND:espiar(playerid, params[])
{
    new Name[MAX_PLAYER_NAME], Msg[128];
   
    SendAdminText(playerid, "/espiar", params);
   
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            if (sscanf(params, "u", params))
                return SendClientMessage(playerid, 0xFF0000AA, "Use: /espiar [id]");
               
            if (IsPlayerConnected(params))
            {
                GetPlayerName(params, Name, MAX_PLAYER_NAME);
                TogglePlayerSpectating(playerid, 1);

                if (GetPlayerVehicleSeat(params) == -1)
                {
                    PlayerSpectatePlayer(playerid, params);
                    SetPlayerInterior(playerid, GetPlayerInterior(params));
                    APlayerData[playerid][SpectateID] = params;
                    APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
                }
                else
                {
                    // The other player is in a vehicle, so spectate the vehicle
                    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(params));
                    APlayerData[playerid][SpectateID] = params;
                    APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(params);
                    APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
                }

                format(Msg, 128, "{00FF00}[MDC] Vocк estб espiando {FFFF00}%s.", Name);
                SendClientMessage(playerid, 0xFFFFFFFF, Msg);
            }
            else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Esse jogador nгo estб online.");
        }
    }
    // Let the server know that this was a valid command
    return 1;
}

e faz tbm o que o nick falou.
Reply
#9

da erros

Quote:

C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3127) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3129) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3132) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3134) : error 035: argument type mismatch (argument 2)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3135) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3136) : error 006: must be assigned to an array
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3142) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3143) : error 006: must be assigned to an array
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\pawno\include\PPC_PlayerCommands.inc( 3144) : error 035: argument type mismatch (argument 1)
C:\Users\WicKxGaMer\Desktop\[GM] Mundo do Caminhoneiro\gamemodes\MDC.pwn(1612) : warning 203: symbol is never used: "Dialog_Neon"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.

se eu fizer oque o nick falou da bug no sistema de login , registro
Reply
#10

Baixa o PPC_Trucking convertido em 0.3x e veja o que tem de diferente do seu e do convertido em 0.3x, pois o de lб acho que nгo tem bugs de id.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)