SA-MP Forums Archive
Agonizar - 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: Agonizar (/showthread.php?tid=535711)



Agonizar - Metzone - 05.09.2014

Hola, mi problema es el siguiente, cuando muero por segunda vez (Despues de abrir el sv), el usuario, en vez de quedarse muerto en el suelo, agonizando, pues aparece en el cielo agonizando, y asi siempre, excepto la primera vez que muero despues de abrir el sv, que si se queda en el sitio...

pawn Код:
// 3 sec tick rate
timer EMSUpdate[3000](){
    foreach(Player, i){
        if(GetPVarType(i, "Injured")){
            if(GetPVarInt(i, "EMSAttempt") != 0){
                new Float:health;
                GetPlayerHealth(i,health);
                if(GetPVarInt(i, "EMSAttempt") == -1)
                {
                    if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                    {
                        Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                        SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                    }
                    SetHP(i, health-5);
                    ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                    GameTextForPlayer(i, "~y~Estas herido~n~~w~/aceptar muerte o /servicios medicos", 5000, 3);
                }
                if(GetPVarInt(i, "EMSAttempt") == 1)
                {
                    if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                    {
                        Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                        SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                    }
                    SetHP(i, health-5);
                    ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                    GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llegue...", 5000, 3);
                }
                if(GetPVarInt(i, "EMSAttempt") == 8)
                {
                    if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                    {
                        Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                        SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                    }
                    SetHP(i, health-5);
                    ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                    GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llegue...", 5000, 3);
                }
                if(GetPVarInt(i, "EMSAttempt") == 2)
                {
                    if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                    {
                        Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                        SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                        SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                    }
                    GameTextForPlayer(i, "~g~Rescatado~n~~w~En espera de atencion medica...", 5000, 3);
                }
                if(GetPVarInt(i, "EMSAttempt") == 3){
                    if(IsPlayerInAnyVehicle(i)){
                        new ambmodel = GetPlayerVehicleID(i);
                        if(GetVehicleModel(ambmodel) == 416){
                            GameTextForPlayer(i, "~g~Rescatado~n~~w~Espera que SAMD te lleve al hospital...", 5000, 3);
                        }
                        else{
                            SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
                            KillEMSQueue(i);
                            SetPVarInt(i, "Hospital", 1);
                            SpawnPlayer(i);
                        }
                    }
                    else{
                        SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
                        KillEMSQueue(i);
                        SetPVarInt(i, "Hospital", 1);
                        SpawnPlayer(i);
                    }
                }
                if(health <= 10)
                {
                    SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te transladу inmediatamente al hospital.");
                    KillEMSQueue(i);
                    SetPVarInt(i, "Hospital", 1);
                    SetHP(i, 50);
                    SpawnPlayer(i);
                }
            }
        }
    }
}

pawn Код:
// SendEMSQueue Function(playerid)
function SendEMSQueue(playerid,type)
{
    switch(type)
    {
        case 1:
        {
            Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
            SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
            SetPVarInt(playerid, "EMSAttempt", -1);
            ClearAnimations(playerid);
            ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);

            if(GetPlayerInterior(playerid) > 0)
            {
                LoadObjects(playerid);
            }
            GameTextForPlayer(playerid, "~y~Estas herido~n~~w~/aceptar muerte o /servicios medicos", 5000, 3);
            SetHP(playerid, 100);
            SetPlayerArmour(playerid,0);
            SetPVarInt(playerid,"MedicCall",1);
        }
        case 2:
        {
            SetPVarInt(playerid,"EMSAttempt", 2);
            //ClearAnimations(playerid);
            ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
            SetHP(playerid, 100);
            SetPlayerArmour(playerid,0);
        }
    }
    return 1;
}



Respuesta: Agonizar - Goncho28 - 05.09.2014

No entiendo que funciуn cumple "EMSAttempt", pero si eso es lo que detecta el estado pone para que cuando lo lleven al hospital se desative

pawn Код:
SetPVarInt(playerid,"EMSAttempt", 0);



Respuesta: Agonizar - roderjit - 05.09.2014

Encontrй esto en un GM:

pawn Код:
timer EMSUpdate[6000](){
foreach(Player, i){
    if(GetPVarType(i, "Injured")){
        if(GetPVarInt(i, "EMSAttempt") != 0){
            new Float:health;
            GetPlayerHealth(i,health);
            if(GetPVarInt(i, "EMSAttempt") == -1)
            {
                if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                {
                    Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                    SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                }
                SetHP(i, health-5);
                ApplyAnimation(i, "CRACK", "crckidle1",4.0,0,1,1,1,-1);
                GameTextForPlayer(i, "~y~Estas herido~n~~w~/aceptar muerte o /servicios", 5000, 3);
            }
            if(GetPVarInt(i, "EMSAttempt") == 1)
            {
                if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                {
                    Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                    SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                }
                SetHP(i, health-5);
                ApplyAnimation(i, "CRACK", "crckidle1",4.0,0,1,1,1,-1);
                GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llege...", 5000, 3);
            }
            if(GetPVarInt(i, "EMSAttempt") == 8)
            {
                if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                {
                    Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                    SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                }
                SetHP(i, health-5);
                ApplyAnimation(i, "CRACK", "crckidle1",4.0,0,1,1,1,-1);
                GameTextForPlayer(i, "~r~Herido~n~~w~Espera que SAMD llege...", 5000, 3);
            }
            if(GetPVarInt(i, "EMSAttempt") == 2)
            {
                if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
                {
                    Streamer_UpdateEx(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerPos(i, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ"));
                    SetPlayerVirtualWorld(i, GetPVarInt(i,"MedicVW"));
                    SetPlayerInterior(i, GetPVarInt(i,"MedicInt"));
                }
                GameTextForPlayer(i, "~g~Rescatado~n~~w~En espera de atencion medica...", 5000, 3);
            }
            if(GetPVarInt(i, "EMSAttempt") == 3){
                if(IsPlayerInAnyVehicle(i)){
                    new ambmodel = GetPlayerVehicleID(i);
                    if(GetVehicleModel(ambmodel) == 416){
                        GameTextForPlayer(i, "~g~Rescatado~n~~w~Espera que SAMD te lleve al hospital...", 5000, 3);
                    }
                    else{
                        SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
                        KillEMSQueue(i);
                        SetPVarInt(i, "Hospital", 1);
                        SpawnPlayer(i);
                    }
                }
                else{
                    SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
                    KillEMSQueue(i);
                    SetPVarInt(i, "Hospital", 1);
                    SpawnPlayer(i);
                }
            }
            if(health <= 10)
            {
                SendClientMessageEx(i, COLOR_WHITE, "Perdiste el conocimiento y se te translado inmediatamente al hospital.");
                KillEMSQueue(i);
                SetPVarInt(i, "Hospital", 1);
                SetHP(i, 50);
                SpawnPlayer(i);
            }
           
        }
       
    }
}
pawn Код:
function SendEMSQueue(playerid,type)
{
switch(type)
{
    case 1:
    {
        Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
        SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
        SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
        SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
        SetPVarInt(playerid, "EMSAttempt", -1);
        ClearAnimations(playerid);
        ApplyAnimation(playerid, "CRACK", "crckidle1",4.0,0,1,1,1,-1);

        if(GetPlayerInterior(playerid) > 0)
        {
            LoadObjects(playerid);
        }
        GameTextForPlayer(playerid, "~y~Estas herido~n~~w~/aceptar muerte o /servicios", 5000, 3);
        SetHP(playerid, 100);
        SetPlayerArmour(playerid,0);
        SetPVarInt(playerid,"MedicCall",1);
    }
    case 2:
    {
        SetPVarInt(playerid,"EMSAttempt", 2);
        //ClearAnimations(playerid);
        ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
        SetHP(playerid, 100);
        SetPlayerArmour(playerid,0);
    }
}
Son bastante parecidos :3


Re: Agonizar - Metzone - 05.09.2014

Mi problema, esque cuando muere por primera vez, queda en el sitio donde muere (Es lo que quiero) Pero cuando muere otra vez, aparece en el cielo, y asi todas las veces que muere. (Menos la primera)


Respuesta: Agonizar - [J]ulian - 05.09.2014

Deberнas dejar OnPlayerDeath, quizбs haya algo mal ahн.


Respuesta: Agonizar - roderjit - 05.09.2014

Hacй un backup de tu cуdigo, agrega el que te pasй, quizбs se soluciona, sino vemos que se puede hacer :3


- Metzone - 06.09.2014

No funcionу eso:

pawn Код:
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(2209) : error 017: undefined symbol "playerTabbedLoop_yT@"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(2210) : error 017: undefined symbol "SpecUpdate_yT@"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(4343) : error 017: undefined symbol "pName"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(4940) : error 017: undefined symbol "ZonasSeguras"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(4973) : error 017: undefined symbol "ZonasSeguras"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(7646) : error 004: function "LoadGaraje" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18429) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18435) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18461) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18503) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18633) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(18646) : error 004: function "SaveThisGaraj" is not implemented
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(29729) : warning 204: symbol is assigned a value that is never used: "string"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(40871) : error 029: invalid expression, assumed zero
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(40871) : error 017: undefined symbol "playerTabbedLoop_yT@"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(40871) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\asd\Escritorio\Jorge\SAMP (Futuro)\Servidores\VortexZone Roleplay\gamemodes\VZRP.pwn(40871) : fatal error 107: too many error messages on one line
En onplayerdeath tengo esto:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(Info[playerid][pWantedLevel] >=2)
{
SetHP(playerid, 100);
{
new string[170];
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
format(string, sizeof(string), "[Radio] {FFFFFF}Esta herido {00D2CF}%s{FFFFFF}, procedan a su arresto.", GetPlayerNameEx(playerid));
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
SendClientMessage(playerid,COLOR_YELLOW,"Has muerto con cargos, espera a la Policнa y te llevarбn.");//este es el mensaje al ponerle el cargo
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED); //animacion
SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
ClearAnimations(playerid);
TogglePlayerControllable(playerid, 0);
Info[playerid][pEstado] = 2;
SetPVarInt(playerid, "PlayerCuffed", 2);
SetPVarInt(playerid, "IsFrozen", 1);
PlayerCuffedTime[playerid] = 300;
return 1;
}



Respuesta: Agonizar - chusothe41 - 06.09.2014

No he entendido muy bien... quizas estes dejando una varible activada en onplayerspawn...


- Metzone - 06.09.2014

Esto es lo ъnico que tengo en onplayerespawn

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!gPlayerLogged{playerid})
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: No has ingresado correctamente al servidor!");
        Kick(playerid);
        return 1;
    }
    if(IsPlayerNPC(playerid)) return 1;
    if(!gPlayerAnimLibsPreloaded[playerid])
    {
        LoadAnimLibs(playerid);
        gPlayerAnimLibsPreloaded[playerid] = 1;
    }
    SetPlayerWantedLevel(playerid, Info[playerid][pWantedLevel]);
    gTeam[playerid] = Info[playerid][pTeam]; //Set the Team
    SetPlayerSpawn(playerid);
    SetPlayerWeapons(playerid);
    OnDuty[playerid] = 0;
    SetPlayerToTeamColor(playerid);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
    SyncPlayerTime(playerid);
    return 1;
}
chusothe41 respondeme a eso que te deje porfavor.


Respuesta: Agonizar - Metzone - 07.09.2014

revivooo