[Duv] OnPlayerUpdate
#1

existe algum "sensor"(tipo onplayerdeath) que indentifique a mudanзa de vida para menor de um certo valor tipo "quem tiver a vida menor que 10 vai morrer"

OnPlayerHealth Existe?

Reply
#2

Quote:
Originally Posted by Krypton
existe algum "sensor"(tipo onplayerdeath) que indentifique a mudanзa de vida para menor de um certo valor tipo "quem tiver a vida menor que 10 vai morrer"

OnPlayerHealth Existe?

Faзa.
Eu usaria o OnPlayerUpdate

pawn Code:
public OnPlayerUpdate(playerid)
{
    new
      str[128],
        Nome[64];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    format(str, sizeof(str), "O jogador %s estб morrendo!");
    if(GetPlayerHealth(playerid) <= 10.0) return SendClientMessageToAll(COR, str);
    return 1;
}
Reply
#3

eu queria um bagulho quando a vida chega se a 10 ele desmaia e tinha que chamar o samu.
Reply
#4

Quote:
Originally Posted by Krypton
eu queria um bagulho quando a vida chega se a 10 ele desmaia e tinha que chamar o samu.
pawn Code:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) <= 10.0)
    {
      new
      str[128],
        Nome[64];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(str, sizeof(str), "O jogador %s estб morrendo! SAMU vem busca o malaco!");
        SendClientMessageToAll(COR, str);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, 1);
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    return 1;
}
Ai coloca pra quando os carinha chegar digitar la o comando e no comando coloca TogglePlayerControllable(iddocara, 1);
Reply
#5

acabei por montar um fs com o codigo mas esta dando error
voce pode corrigir para min?
edit:
ja sei oque e!!! qual e o include do OnPlayerUpdate?

FS
pawn Code:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <cpstream>
#include <Y_Objects>
#define VERDE   0x33AA33AA

forward Morte(playerid);
forward Morte2(playerid);
forward Morte3(playerid);

public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) <= 10.0)
    {
      new
      str[128],
        Nome[64];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(str, sizeof(str), "O jogador %s estб morrendo!Liguem Para o SAMU");
        SendClientMessageToAll(VERDE, str);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, 1);
        TogglePlayerControllable(playerid, 0);
    SetTimerEx("Morte",1*60000, false, "d", playerid);//
        return 1;
    }


public Morte(playerid);

{
   SetPlayerHealth(playerid, 55.0)
     SetTimerEx("Morte2",1*60000, false, "d", playerid);
     return 1;
}


public Morte2(playerid);
{
  GetPlayerHealth(playerid, 05.0)
  SendClientMessage(playerid, VERDE, "O samu Demorou muito voce йsta em coma!");
  SetPlayerPos(playerid,1939.5685,-2121.9780,-18.6666);
  SetPlayerHealth(playerid,55.0);
    TogglePlayerControllable(playerid,0);//Congela
  SendClientMessage(playerid, VERDE, "Vocк Estб em Coma!");
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0);
    SetTimerEx("Morte3",1*60000, false, "d", playerid);
    return 1;
   

}
   
public Morte3(playerid);
{
  SendClientMessage(playerid, VERDE, "Vocк Acordou do Coma!");
  SetPlayerPos(playerid,1176.8536,-1323.3251,14.0418);
    TogglePlayerControllable(playerid,1);
  return 1;
}
//CREDITOS:
//{
//[VGS]speliarmos_OC : me ajudou a fazer os scripts!!!!!!!!!
//Filter script montado por min : Krypton
ERRO
pawn Code:
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(18) : warning 202: number of arguments does not match definition
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : warning 217: loose indentation
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : error 004: function "Morte" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(37) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : warning 225: unreachable code
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : error 004: function "Morte2" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(44) : error 035: argument type mismatch (argument 2)
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : warning 225: unreachable code
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : error 004: function "Morte3" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(69) : error 030: compound statement not closed at the end of file (started at line 18)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
Reply
#6

Krypton, use [ pawn ] ao invйs de [ code ]
E coloque somente as linhas com erro e os erros
Reply
#7

Quote:
Originally Posted by Krypton
acabei por montar um fs com o codigo mas esta dando error
voce pode corrigir para min?
edit:
ja sei oque e!!! qual e o include do OnPlayerUpdate?

FS
pawn Code:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <cpstream>
#include <Y_Objects>
#define VERDE   0x33AA33AA

forward Morte(playerid);
forward Morte2(playerid);
forward Morte3(playerid);

public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) <= 10.0)
    {
      new
      str[128],
        Nome[64];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(str, sizeof(str), "O jogador %s estб morrendo!Liguem Para o SAMU");
        SendClientMessageToAll(VERDE, str);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, 1);
        TogglePlayerControllable(playerid, 0);
    SetTimerEx("Morte",1*60000, false, "d", playerid);//
        return 1;
    }


public Morte(playerid);

{
   SetPlayerHealth(playerid, 55.0)
     SetTimerEx("Morte2",1*60000, false, "d", playerid);
     return 1;
}


public Morte2(playerid);
{
  GetPlayerHealth(playerid, 05.0)
  SendClientMessage(playerid, VERDE, "O samu Demorou muito voce йsta em coma!");
  SetPlayerPos(playerid,1939.5685,-2121.9780,-18.6666);
  SetPlayerHealth(playerid,55.0);
    TogglePlayerControllable(playerid,0);//Congela
  SendClientMessage(playerid, VERDE, "Vocк Estб em Coma!");
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0);
    SetTimerEx("Morte3",1*60000, false, "d", playerid);
    return 1;
   

}
   
public Morte3(playerid);
{
  SendClientMessage(playerid, VERDE, "Vocк Acordou do Coma!");
  SetPlayerPos(playerid,1176.8536,-1323.3251,14.0418);
    TogglePlayerControllable(playerid,1);
  return 1;
}
//CREDITOS:
//{
//[VGS]speliarmos_OC : me ajudou a fazer os scripts!!!!!!!!!
//Filter script montado por min : Krypton
ERRO
pawn Code:
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(18) : warning 202: number of arguments does not match definition
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : warning 217: loose indentation
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(33) : error 004: function "Morte" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(37) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : warning 225: unreachable code
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(42) : error 004: function "Morte2" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(44) : error 035: argument type mismatch (argument 2)
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : warning 225: unreachable code
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : error 029: invalid expression, assumed zero
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(57) : error 004: function "Morte3" is not implemented
C:\Users\Tadeu\Contacts\Desktop\samp server\filterscripts\10l.pwn(69) : error 030: compound statement not closed at the end of file (started at line 18)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
OnPlayerUpdate ja й funзгo do samp.
Reply
#8

pawn Code:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <cpstream>
#include <Y_Objects>
#define VERDE   0x33AA33AA
forward Coma(playerid);
forward hs(playerid);
public OnPlayerUpdate(playerid)
{

 if(GetPlayerHealth(playerid) <= 20.0)
    {
      new str[128];
    new Nome[64];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(str, sizeof(str), "O jogador %s estб morrendo! Liguem para o Samu!!!");
        SendClientMessageToAll(VERDE, str);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, 1);
        TogglePlayerControllable(playerid, 0);
        SetTimerEx("Coma",2*15000, false, "d", playerid);
   return 1;
}
}

public Coma(playerid)
{
    new cut;
    new string[256];
  SetPlayerPos(playerid, 1939.5685,-2121.9780,-18.6666);
    format(string, sizeof(string), "Hospital: Vocк Estб em Coma.", cut);
  SendClientMessage(playerid, VERDE, string);
    SetTimerEx("hs",2*15000, false, "d", playerid);
    return 1;
}

public hs(playerid)

{

 SetPlayerHealth(playerid, 0.0);
 
 return 1;
 
}
eu acabei de fazer nao tem erros e nao ta funcionando nao sei porque eu chego a menos de 10.0 de vida e nao acontece nada!
Reply
#9

#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <cpstream>
#include <Y_Objects>
#define VERDE 0x33AA33AA
forward Coma(playerid);
forward hs(playerid);

public OnPlayerUpdate(playerid)
{
if(GetPlayerHealth(playerid) <= 20.0)
{
new str[128];
new Nome[64];
GetPlayerName(playerid, Nome, sizeof(Nome));
format(str, sizeof(str), "O jogador %s estб morrendo! Liguem para o Samu!!!");
SendClientMessageToAll(VERDE, str);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, 1);
TogglePlayerControllable(playerid, 0);
SetTimerEx("Coma",30000, false, "d", playerid);
return 1;
}
}

public Coma(playerid)
{
new cut;
new string[256];
SetPlayerPos(playerid, 1939.5685,-2121.9780,-18.6666);
format(string, sizeof(string), "Hospital: Vocк Estб em Coma.", cut);
SendClientMessage(playerid, VERDE, string);
SetTimerEx("hs",30000, false, "d", playerid);
return 1;
}

public hs(playerid)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)