SA-MP Forums Archive
Vida infinita - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Vida infinita (/showthread.php?tid=476144)



Vida infinita - ValenRatti - 16.11.2013

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;



Respuesta: Vida infinita - benjas09 - 16.11.2013

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;



Re: Vida infinita - ValenRatti - 16.11.2013

Me tira error en otras lineas


Respuesta: Vida infinita - benjas09 - 16.11.2013

que lineas


Re: Vida infinita - ValenRatti - 16.11.2013

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"


Respuesta: Vida infinita - OTACON - 16.11.2013

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?...


Respuesta: Vida infinita - benjas09 - 16.11.2013

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


- ValenRatti - 16.11.2013

Y como lo aplicaria en mi caso?

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

SetPlayerHealth(playerid, FLOAT_INFINITY);



Respuesta: Vida infinita - benjas09 - 16.11.2013

Quiizas ya tenias definido a infinity o algo jaja.

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


Re: Vida infinita - ValenRatti - 16.11.2013

Creo que lo habia definido en un lugar incorrecto