[duda]con caerse al agua
#1

hola miren lo que pasa es que
yo hice un map de derby en el cual lo uso para evento
y miren tengo una duda sobre eso el derby esta arriva del agua
y mi pregunta es la siguiente como se hace para que cuando uno caiga al agua
spawnee y salga del evento automaticamente como se hace
siempre me he preguntado como hacen eso
por favor alguien digame se lo agradeceria mucho!
nos vemos
Reply
#2

Encontrй esto:

pawn Код:
stock EstaEnAgua(playerid)
{
    new Animacion[32], Libreria[32];
    GetAnimationName(GetPlayerAnimationIndex(playeid), Libreria, sizeof(Libreria), Animacion, sizeof(Animacion));
    if(!strcmp(Libreria, "SWIM", true))
    {
        return 1;
    }
    return 0;
}
Lo que deberнa ser algo asн:

pawn Код:
//
    if(EstaEnAgua(playerid))
    {
        if(EstaEnElEventoASD[playerid] == 1) // Pon tu variable.
        {
            SpawnPlayer(playerid);
            EstaEnElEventoASD[playerid] = 0; // Pon tu variable.
        }
    }
Recuerda usar un timer para detectar si el jugador estб en el agua.
Reply
#3

Mira este es el comando del derby
sobre el stock es ovio que va en donde estan mis stocks
pero no entendi como vendria a hacer el comando para que lo detecte
y lo sake cuando se caiga al agua!

Quote:

if(!strcmp(cmdtext, "/derby3", true))
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health >= 70)

{
EnviarMensaje(playerid,"Derby3");
SetPlayerPos(playerid, 1106.7439,3658.3748,142.6193);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 16);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "[ADVERTENCIA] Por favor Llena tu vida antes de usar los TelePorts.");
}
return 1;
}

como vendria a hacer me podes decir?
Reply
#4

Una duda: cuбndo dejarбs el Copy&Paste? Nunca aprenderбs si vives pidiendo los cуdigos.

Bueno, ya que me pillaste de buen humor, te hago el cуdigo:


pawn Код:
// Array global
new TimerDetectWater[MAX_PLAYERS];

// Comando.
if(!strcmp(cmdtext, "/derby3", true))
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health >= 70)
    {
        EnviarMensaje(playerid, "Derby3");
        SetPlayerPos(playerid, 1106.7439, 3658.3748, 142.6193);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 16);
        TimerDetectWater[playerid] = SetTimerEx("DetectarAgua", 1000, true, "d", playerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_YELLOW, "[ADVERTENCIA] Por favor Llena tu vida antes de usar los TelePorts.");
    }
    return 1;
}

// Funciуn llamada.
forward DetectarAgua(playerid);
public DetectarAgua(playerid)
{
    if(EstaEnElEventoASD[playerid] == 1) // Pon tu variable.
    {
        if(EstaEnAgua(playerid))
        {
            SpawnPlayer(playerid);
            EstaEnElEventoASD[playerid] = 0; // Pon tu variable.
            KillTimer(TimerDetectWater[playerid]);
        }
    }
    return 1;
}
Reply
#5

Tambiйn puedes hacerlo detectando si la posiciуn Z es menor a la del agua (no se si es 0.... en ese caso serнa Z < 0).
Reply
#6

me salen estos errores :C
Quote:

D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(192) : error 017: undefined symbol "TEXT_DRAW_FONT_MODEL_PREVIEW"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(196) : error 017: undefined symbol "PlayerTextDrawSetPreviewModel"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(197) : error 017: undefined symbol "PlayerTextDrawSetPreviewRot"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(189) : warning 203: symbol is never used: "mZoom"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(189) : warning 203: symbol is never used: "Zrot"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(189) : warning 203: symbol is never used: "Yrot"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(189) : warning 203: symbol is never used: "Xrot"
D:\Escritorio\Archivos - Samp\copia de seguridad\pawno\include\mSelection.inc(189) : warning 203: symbol is never used: "modelindex"
D:\Escritorio\Archivos - Samp\ZeroAttack-ControlFR\gamemodes\ZaC.pwn(48929) : error 017: undefined symbol "EstaEnElEventoASD"
D:\Escritorio\Archivos - Samp\ZeroAttack-ControlFR\gamemodes\ZaC.pwn(48929) : warning 215: expression has no effect
D:\Escritorio\Archivos - Samp\ZeroAttack-ControlFR\gamemodes\ZaC.pwn(48929) : error 001: expected token: ";", but found "]"
D:\Escritorio\Archivos - Samp\ZeroAttack-ControlFR\gamemodes\ZaC.pwn(48929) : error 029: invalid expression, assumed zero
D:\Escritorio\Archivos - Samp\ZeroAttack-ControlFR\gamemodes\ZaC.pwn(48929) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Errors.

Reply
#7

Es por tu include 'mSelection'.
Reply
#8

Quote:
Originally Posted by leon44
Посмотреть сообщение
me salen estos errores :C
llora y haste bolita, ah y actualiza tus includes.
Reply
#9

Quote:
Originally Posted by adri1
Посмотреть сообщение
Tambiйn puedes hacerlo detectando si la posiciуn Z es menor a la del agua (no se si es 0.... en ese caso serнa Z < 0).
Eso servirнa mбs porque si es para un "derby" el jugador cae al agua con un auto, no nadando
Reply
#10

Quote:
Originally Posted by MillerUTL
Посмотреть сообщение
Eso servirнa mбs porque si es para un "derby" el jugador cae al agua con un auto, no nadando
Entonces llamamos a 'OnVehicleDeath'.



https://sampwiki.blast.hk/wiki/OnVehicleDeath_ES
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)