[Ajuda] Comando /190
#1

alguem pode me ajuda acriar um comando para limpar ficha quando nao tem policia online...ta aki uma base de um comando de /assistencia meu GM й de trucking....

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

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

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Get the player's name
        GetPlayerName(playerid, Name, sizeof(Name));
        // Preset the message that needs to be sent to assistance players
        format(Msg, 128, "{00FF00}O jogador {FFFF00}%s{00FF00} precisa de assistкncia mecвnica.", Name);

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

        // Check if there is at least one assistance player online
        if (AssistOnline == true)
        {
            // Set yourself as "AssistanceNeeded"
            APlayerData[playerid][AssistanceNeeded] = true;
            // Let the player know he called for assistance
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}[BTM] Vocк ja pediu ajuda.");
        }
        else // No assistance is online
        {
            // Check if the player is the driver of a vehicle
            if (GetPlayerVehicleSeat(playerid) == 0)
            {
                // Fully repair the vehicle (damage value and bodywork)
                RepairVehicle(GetPlayerVehicleID(playerid));
                // Also re-fuel the vehicle
                AVehicleData[GetPlayerVehicleID(playerid)][Fuel] = MaxFuel;
                // Let the player pay for the repairs and refuel (default $2000)
                RewardPlayer(playerid, -2000, 0);
                // Let the player know he spent $2000 for auto-repair because there were no assistance players online
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[BTM] Seu veнculo foi reparado e abastecido por R$2000.");
                SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[BTM] Nгo hа mecвnico online.");
            }
        }
    }
    else
        return 0;

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

tem alguma variavel que guarda o valor da ficha do player que indica se ta suja ou limpa?
a ficha do player e salva em algum lugar .ini etc?
impossivel fazer um cmd pra limpa ficha sem essas informaзoes.
Reply
#3

entao oq tenho q fazer pra lidar esse .INI me encina oq eu tenho q fazer PF ..
Reply
#4

PHP код:
    if(strcmp(cmd"/tirarsu"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if (
PlayerInfo[playerid][pAdmin] >= AKI VC SETA O ADMIN OU TIRA ESSA LINHA PARA O JOGADOR)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: (/tirarsu) [id] 0");
                    return 
true;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                          
//new playerid;
                        
new length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: (/tirarsu [id] 0");
                            return 
true;
                        }
                        
WantedPoints[playerid] = 0;
                        
SetPlayerWantedLevel(playerid0);
                        return 
true;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"  Esse jogador nгo estб conectado.");
                    return 
true;
                }
               }
        }
        return 
true;
    } 
se ajudei +rep
Reply
#5

pawn Код:
CMD:limparficha(playerid, params[])
{
    new Nome[MAX_PLAYER_NAME], Nome2[MAX_PLAYER_NAME], Celulas[120];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Use /limparficha [Id]");
    GetPlayerName(playerid, Nome, sizeof(Nome));
    GetPlayerName(id, Nome2, sizeof(Nome2));
    format(Celulas, sizeof(Celulas), "O Policial %s limpou a ficha do jogador %s", Nome, Nome2);
    SendClientMessageToAll(-1, Celulas);
    SendClientMessage(id, -1,"Vocк nгo й mais um procurado !");
    SetPlayerWantedLevel(id, 0);
    return 1;
}
Reply
#6

vo olha aki qual vai dar certo e do +REP pro dois por me ajuda ok...
Reply
#7

eu queria pro PLAYER usar o comando quando nao tem POLICIA como ta la em cima /assitencia...
Reply
#8

LIPE olha ai oq deu no seu comando...
pawn Код:
C:\Users\Pedro Henrque\Desktop\igual\BTM_Samp\pawno\include\PPC_PlayerCommands.inc(9) : error 017: undefined symbol "id"
C:\Users\Pedro Henrque\Desktop\igual\BTM_Samp\pawno\include\PPC_PlayerCommands.inc(11) : error 017: undefined symbol "id"
C:\Users\Pedro Henrque\Desktop\igual\BTM_Samp\pawno\include\PPC_PlayerCommands.inc(14) : error 017: undefined symbol "id"
C:\Users\Pedro Henrque\Desktop\igual\BTM_Samp\pawno\include\PPC_PlayerCommands.inc(15) : error 017: undefined symbol "id"
C:\Users\Pedro Henrque\Desktop\igual\BTM_Samp\gamemodes\BTM.pwn(1645) : warning 203: symbol is never used: "Dialog_Neon"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

apague a linha 1645

e no topo do gm adicione isto

pawn Код:
new id;
Reply
#10

vo olha aki mais queria um comando q o PLAYER usa quando nao tem policia online.... tem como..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)