SA-MP Forums Archive
[Pedido] Dano mбximo sniper e /motor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Dano mбximo sniper e /motor (/showthread.php?tid=458319)



Dano mбximo sniper e /motor - SouUmaJujuba - 16.08.2013

Alguйm tem um /motor? Ex: Ao player digitar o comando o veiculo se desliga totalmente... Ao digitar novamente o mesmo comando o veнculo se liga novamente.

Como que "dou" o dano mбximo a sniper?



Re: Dano mбximo sniper e /motor - darkxdll - 16.08.2013

Vб na callback , OnPlayerTakeDamage , e use GetPlayerWeapon e usa o amount para tirar 100 de life x)


Re: Dano mбximo sniper e /motor - Juniiro3 - 16.08.2013

/motor:

pawn Код:
new bool:Motor[MAX_PLAYERS];

if (strcmp(cmdtext, "/motor") == 0) //strcmp
{
    new Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo, Veiculo;
   
    Veiculo = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(Veiculo, Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo);
   
    if (Motor[playerid] == true)
    {
        SetVehicleParamsEx(Veiculo, 0, 0, Alarme, Portas, Capo, PortaMalas, Objetivo);
        Motor[playerid] = false;
    }
    else
    {
        SetVehicleParamsEx(vehicleid, 1, 1, 0, Portas, Capo, PortaMalas, Objetivo);
        Motor[playerid] = true;
    }
   
    return 1;
}

COMMAND:motor(playerid, params[])//zcmd
{
    new Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo, Veiculo;
   
    Veiculo = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(Veiculo, Motor, Luzes, Alarme, Portas, Capo, PortaMalas, Objetivo);
   
    if (Motor[playerid] == true)
    {
        SetVehicleParamsEx(Veiculo, 0, 0, Alarme, Portas, Capo, PortaMalas, Objetivo);
        Motor[playerid] = false;
    }
    else
    {
        SetVehicleParamsEx(vehicleid, 1, 1, 0, Portas, Capo, PortaMalas, Objetivo);
        Motor[playerid] = true;
    }
   
    return 1;
}
EDIT @OFF:

darkxdll tб de perseguiзгo comigo o.O sempre respondendo os mesmos tуpicos kkk


Re : Dano mбximo sniper e /motor - ThiagoMK - 16.08.2013

O comando para ligar e desligar й esse sу que para ligar й /motor 1 e para desligar й /motor 0

pawn Код:
COMMAND:motor(playerid, params[])
{
    // Setup local variables
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;

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

            // Get the player's vehicle
            vehicleid = GetPlayerVehicleID(playerid);

            // Get the current status of the vehicle
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

            // Check if the player is inside a vehicle
            if (vehicleid != 0)
            {
                if (sscanf(params, "i", engine)) SendClientMessage(playerid, 0xFF0000AA, "Use: /motor [0-1]");
                else
                {
                    // Set the engine to the value that was passed by the player and leave all other parameters alone
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                }
            }
            else
                SendClientMessage(playerid, 0x00FF00FF, "Vocк precisa estar dentro de um veнculo para desligб-lo/ligб-lo.");
        }
        else
            return 0;
    }
    else
        return 0;

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



Re: Re : Dano mбximo sniper e /motor - Juniiro3 - 16.08.2013

Quote:
Originally Posted by ThiagoMK
Посмотреть сообщение
O comando para ligar e desligar й esse sу que para ligar й /motor 1 e para desligar й /motor 0

pawn Код:
COMMAND:motor(playerid, params[])
{
    // Setup local variables
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;

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

            // Get the player's vehicle
            vehicleid = GetPlayerVehicleID(playerid);

            // Get the current status of the vehicle
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

            // Check if the player is inside a vehicle
            if (vehicleid != 0)
            {
                if (sscanf(params, "i", engine)) SendClientMessage(playerid, 0xFF0000AA, "Use: /motor [0-1]");
                else
                {
                    // Set the engine to the value that was passed by the player and leave all other parameters alone
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                }
            }
            else
                SendClientMessage(playerid, 0x00FF00FF, "Vocк precisa estar dentro de um veнculo para desligб-lo/ligб-lo.");
        }
        else
            return 0;
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
Thiago, como que tu passa o comando pro cara com as variбveis do teu GM PPC_TRUCKING?


Re: Dano mбximo sniper e /motor - Mteck - 16.08.2013

pawn Код:
C:\Users\Richard\Desktop\url.pwn(44) : error 029: invalid expression, assumed zero
C:\Users\Richard\Desktop\url.pwn(44) : error 017: undefined symbol "cmd_motor"
C:\Users\Richard\Desktop\url.pwn(44) : error 029: invalid expression, assumed zero
C:\Users\Richard\Desktop\url.pwn(44) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Blza Tiago, resolve ai.
pawn Код:
CMD:motor(playerid, params[])



Re: Dano mбximo sniper e /motor - bruxo00 - 16.08.2013

pawn Код:
#include < zcmd >