Vida infinita
#1

Hola, miren yo para los adminstradores hice que cuando ponen el comando /adminduty la vida se les pone en 99999 para que sea infinita, con los disparos funciona pero si caigo de gran distancia la vida si que baja, ayuda! este es el cmd.
pawn Код:
zcmd(adminduty, playerid, params[])
    {
    new string[431];

    if(Info[playerid][pAdminZC] > 0)
    {

    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerColor(playerid,0xFFFF20FF);
    SetPlayerHealth(playerid, 99999);
    SetPlayerArmour(playerid, 99999); // Chaleco infinito
    SetPlayerSkin(playerid, 217);  // Skin administrativo

    format(string, sizeof(string), "El administrador %s estб On Duty. Contбctalo por /w.",  GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAll(0xEC13E7FF, string);
    return 1;
    }
    else
    {
    AdminDuty[playerid] = 0;


    SetHP(playerid, 100);
    SetPlayerArmour(playerid, 0);
    SetPlayerColor(playerid,-1);

    format(string, sizeof(string), "El Administrador %s ya no estб On Duty.", GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAllEx(0xEC13E7FF, string);
    return 1;
    }
    } else SendClientMessage(playerid, -1,"No eres administrador.");
    return 1;
Reply
#2

pawn Код:
zcmd(adminduty, playerid, params[])
    {
#define INFINITY    (Float:0x7F800000)
    new string[431];

    if(Info[playerid][pAdminZC] > 0)
    {

    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerColor(playerid,0xFFFF20FF);
    SetPlayerHealth (playerid,INFINITY);
    SetPlayerArmour (playerid,INFINITY);
    SetPlayerSkin(playerid, 217);  // Skin administrativo

    format(string, sizeof(string), "El administrador %s estб On Duty. Contбctalo por /w.",  GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAll(0xEC13E7FF, string);
    return 1;
    }
    else
    {
    AdminDuty[playerid] = 0;


    SetHP(playerid, 100);
    SetPlayerArmour(playerid, 0);
    SetPlayerColor(playerid,-1);

    format(string, sizeof(string), "El Administrador %s ya no estб On Duty.", GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAllEx(0xEC13E7FF, string);
    return 1;
    }
    } else SendClientMessage(playerid, -1,"No eres administrador.");
    return 1;
Reply
#3

Me tira error en otras lineas
Reply
#4

que lineas
Reply
#5

2591) : error 017: undefined symbol "VehicleUpdate_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2592) : error 017: undefined symbol "ServerMicrobeat_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2593) : error 017: undefined symbol "SyncUp_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2594) : error 017: undefined symbol "Mensajes_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2595) : error 017: undefined symbol "EMSUpdate_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2596) : error 017: undefined symbol "playerTabbedLoop_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2597) : error 017: undefined symbol "SpecUpdate_yT@"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2653) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2655) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2662) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2664) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2665) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2672) : error 017: undefined symbol "GetPlayerVehicle"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2673) : error 017: undefined symbol "UpdatePlayerVehicleMods"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2715) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2729) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2743) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2755) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(276 : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2782) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2796) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2810) : error 017: undefined symbol "NOPCheck"
C:\Documents and Settings\Administrador\Escritorio\Latin RolePlay\gamemodes\ZenonCity.net.pwn(2824) : error 017: undefined symbol "NOPCheck"
Reply
#6

Quote:
Originally Posted by benjas09
Посмотреть сообщение
pawn Код:
zcmd(adminduty, playerid, params[])
    {
#define INFINITY    (Float:0x7F800000)
    new string[431];

    if(Info[playerid][pAdminZC] > 0)
    {

    if(AdminDuty[playerid] == 0)
    {
    AdminDuty[playerid] = 1;
    SetPlayerColor(playerid,0xFFFF20FF);
    SetPlayerHealth (playerid,INFINITY);
    SetPlayerArmour (playerid,INFINITY);
    SetPlayerSkin(playerid, 217);  // Skin administrativo

    format(string, sizeof(string), "El administrador %s estб On Duty. Contбctalo por /w.",  GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAll(0xEC13E7FF, string);
    return 1;
    }
    else
    {
    AdminDuty[playerid] = 0;


    SetHP(playerid, 100);
    SetPlayerArmour(playerid, 0);
    SetPlayerColor(playerid,-1);

    format(string, sizeof(string), "El Administrador %s ya no estб On Duty.", GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAllEx(0xEC13E7FF, string);
    return 1;
    }
    } else SendClientMessage(playerid, -1,"No eres administrador.");
    return 1;

que es esto? #define INFINITY (Float:0x7F800000) O_O?...
Reply
#7

Quote:
Originally Posted by OTACON
Посмотреть сообщение
que es esto? #define INFINITY (Float:0x7F800000) O_O?...
pawn Код:
new
    Float:gPlayerHealth[MAX_PLAYERS];
 
#if !defined INFINITY
    #define INFINITY (Float:0x7F800000)
#endif
 
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_ACTION))
    {
        // They just pressed the action key, save their
        // old health for restoration.
        GetPlayerHealth(playerid, gPlayerHealth[playerid]);
        SetPlayerHealth(playerid, INFINITY);
    }
    else if (RELEASED(KEY_ACTION))
    {
        // They just let go of action - restore
        // their old health again.
        SetPlayerHealth(playerid, gPlayerHealth[playerid]);
    }
    return 1;
}

Lo puedes ver en

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#8

Y como lo aplicaria en mi caso?

Pude solucionarlo asi:
pawn Код:
#define FLOAT_INFINITY      (Float:0x7F800000)

SetPlayerHealth(playerid, FLOAT_INFINITY);
Reply
#9

Quiizas ya tenias definido a infinity o algo jaja.

Porque el codigo que te di yo, es como yo lo tengo funcionando
Reply
#10

Creo que lo habia definido en un lugar incorrecto
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)