[Ajuda] Comando nao existe
#1

[I]Tenho um comando aqui que ele chama policia e tals , mas quando eu digito ele , ele da como comando inexistente , acho q deve ser problema de return mas , eai alguem me ajuda?

pawn Код:
COMMAND:190(playerid, params[])
{
    // Setup local variables
    new bool:CopOnline = false, Msg[128], Name[24], Fine;

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

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerClass] == ClassPolice)
        {
            if (GetPlayerWantedLevel(playerid) >= 3)
            {
                // Get the player's name
                GetPlayerName(playerid, Name, sizeof(Name));
                // Preset the message that needs to be sent to cops
                format(Msg, 128, "{0000FF}Jogador {FFFFFF}%s{0000FF} estб precisando de algum policial!", Name);

                // Check if there is at least one cop online
                for (new i; i < MAX_PLAYERS; i++)
                {
                    // Check if this player is connected
                    if (IsPlayerConnected(i))
                    {
                        // Check if this player is cops
                        if (APlayerData[i][PlayerClass] == ClassPolice)
                        {
                            // Set the flag to indicate that at least one cop is online
                            CopOnline = true;
                            // Send the cop a message to inform him who needs fine
                            SendClientMessage(i, 0xFFFFFFFF, Msg);
                        }
                    }
                }

                // Check if there is at least one cop online
                if (CopOnline == true)
                {
                    // Let the player know that atleast one cop is online who can fine him
                    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Existe policiais online, aguarde...");
                }
                else // No cop is online
                {

                    // Calculate the fine
                    Fine = GetPlayerWantedLevel(playerid) * DefaultFinePerStar;
                    // Let the wanted player pay the fine
                    RewardPlayer(playerid, -Fine, 0);

                    // Remove wanted level
                    SetPlayerWantedLevel(playerid, 0);

                    // Let the player know that he has been auto-fined
                    format(Msg, sizeof(Msg), "{0000FF}Sua ficha foi limpa no valor de {00FF00}R${FFFFFF}%i {0000FF}pelo motivo de nгo existir policial online", Fine);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
            }
            else
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar /190 quando nгo estб sendo procurado!");
        }
        else
            return 0;
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
} [/i]
Reply
#2

ele esta em um fs ?
Reply
#3

Nгo nгo
Reply
#4

Upp ?
Reply
#5

Este comando sу vai funcionar se o cara que usa-lo for policial e tiver mais que 3 leveis de procurado. '-'
Reply
#6

Quote:
Originally Posted by Nickvj7
Посмотреть сообщение
Este comando sу vai funcionar se o cara que usa-lo for policial e tiver mais que 3 leveis de procurado. '-'
e q um amigo q me passou , eu percebi , eu ja to ajeitando , fui preguiзoso e n li o codigo


@EDIT

Mudei olha

pawn Код:
COMMAND:190(playerid, params[])
{
// Setup local variables
new bool:CopOnline = false, Msg[128], Name[24], Fine;

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

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{

if (GetPlayerWantedLevel(playerid) >= 1)
{
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Preset the message that needs to be sent to cops
format(Msg, 128, "{0000FF}Jogador {FFFFFF}%s{0000FF} estб precisando de algum policial!", Name);

// Check if there is at least one cop online
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Check if this player is cops
if (APlayerData[i][PlayerClass] == ClassPolice)
{
// Set the flag to indicate that at least one cop is online
CopOnline = true;
// Send the cop a message to inform him who needs fine
SendClientMessage(i, 0xFFFFFFFF, Msg);
}
}
}

// Check if there is at least one cop online
if (CopOnline == true)
{
// Let the player know that atleast one cop is online who can fine him
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Existe policiais online, aguarde...");
}
else // No cop is online
{

// Calculate the fine
Fine = GetPlayerWantedLevel(playerid) * DefaultFinePerStar;
// Let the wanted player pay the fine
RewardPlayer(playerid, -Fine, 0);

// Remove wanted level
SetPlayerWantedLevel(playerid, 0);

// Let the player know that he has been auto-fined
format(Msg, sizeof(Msg), "{0000FF}Sua ficha foi limpa no valor de {00FF00}R${FFFFFF}%i {0000FF}pelo motivo de nгo existir policial online", Fine);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar /190 quando nгo estб sendo procurado!");
}

else
return 0;

// Let the server know that this was a valid command
return 1;
}
ta certo ?
Reply
#7

Quote:
Originally Posted by Luucass
Посмотреть сообщение
Mudei olha

pawn Код:
COMMAND:190(playerid, params[])
{
// Setup local variables
new bool:CopOnline = false, Msg[128], Name[24], Fine;

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

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{

if (GetPlayerWantedLevel(playerid) >= 1)
{
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Preset the message that needs to be sent to cops
format(Msg, 128, "{0000FF}Jogador {FFFFFF}%s{0000FF} estб precisando de algum policial!", Name);

// Check if there is at least one cop online
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Check if this player is cops
if (APlayerData[i][PlayerClass] == ClassPolice)
{
// Set the flag to indicate that at least one cop is online
CopOnline = true;
// Send the cop a message to inform him who needs fine
SendClientMessage(i, 0xFFFFFFFF, Msg);
}
}
}

// Check if there is at least one cop online
if (CopOnline == true)
{
// Let the player know that atleast one cop is online who can fine him
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Existe policiais online, aguarde...");
}
else // No cop is online
{

// Calculate the fine
Fine = GetPlayerWantedLevel(playerid) * DefaultFinePerStar;
// Let the wanted player pay the fine
RewardPlayer(playerid, -Fine, 0);

// Remove wanted level
SetPlayerWantedLevel(playerid, 0);

// Let the player know that he has been auto-fined
format(Msg, sizeof(Msg), "{0000FF}Sua ficha foi limpa no valor de {00FF00}R${FFFFFF}%i {0000FF}pelo motivo de nгo existir policial online", Fine);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк nгo pode usar /190 quando nгo estб sendo procurado!");
}

else
return 0;

// Let the server know that this was a valid command
return 1;
}
ta certo ?
Testou pra ver se estб funcionando fera?
Reply
#8

Quote:
Originally Posted by Nickvj7
Посмотреть сообщение
Testou pra ver se estб funcionando fera?
Testei , vlw mano ! funcionou d boa
add skype : Luucass52 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)