[Pedido] Dano mбximo sniper e /motor
#1

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?
Reply
#2

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

/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
Reply
#4

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;
}
Reply
#5

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?
Reply
#6

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[])
Reply
#7

pawn Код:
#include < zcmd >
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)