[DUV] Sistema de Retirar Vida de Todos -
Coco-Marrom - 19.08.2010
Eu fiz um sistema de retirar vida de todos os usuarios a cada 1 segundo
mas nгo estб funcionando... os usuбrios morrem x.x...
eu usei o settimer
e o setplayerhealth...
alguem pode me dar uma luz de como fazer o sistema de retirar 1 de vida de todos os usuarios a cada 1 segundo?
nao ta funcionando
sim,eu coloquei pra por - 1.0 do valor da vida atual do cara
Re: [DUV] Sistema de Retirar Vida de Todos -
LeLeTe - 19.08.2010
pawn Код:
forward VidaTodos();
public VidaTodos();
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:Vida;
GetPlayerHealth(playerid, Vida);
SetPlayerHealth(playerid, Vida - 1);
}
}
}
//No OnGameModeInit
SetTimer("VidaTodos", 1000, 1); //1000 = Milisegundos. Ou seja, cada segundo equivale a 1000.
Espero ter ajudado
Mas se vocк quiser fazer isso numa бrea especнfica(Exemplo:Uma бrea com material radioativo), sу falar que eu te ensino
Re: [DUV] Sistema de Retirar Vida de Todos -
matheuzinho - 19.08.2010
Isso da бrea, й IsPlayerInArea? Nunca mechi com essa funзгo... sу PlayerToPoint. Pode me explicar? =)
Re: [DUV] Sistema de Retirar Vida de Todos -
Dr_Pawno - 19.08.2010
pawn Код:
forward VidaTodos(playerid);
public VidaTodos(playerid)
{
new Float:Cords[3];
GetPlayerPos(playerid, Cords[0], Cords[1], Cords[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 20, Cords[0], Cords[1], Cords[2]))
{
GetPlayerHealth(playerid, Cords[3]);
SetPlayerHealth(playerid, Cords[3] -1.0);
return 1;
}
}
return 1;
}
tenta isso
Re: [DUV] Sistema de Retirar Vida de Todos -
Coco-Marrom - 19.08.2010
C:\Documents and Settings\Gabriel\Desktop\PAWNO\PROJECTS\GAMEMODE.p wn(34405) : error 055: start of function body without function header
C:\Documents and Settings\Gabriel\Desktop\PAWNO\PROJECTS\GAMEMODE.p wn(34406) : error 010: invalid function or declaration
C:\Documents and Settings\Gabriel\Desktop\PAWNO\PROJECTS\GAMEMODE.p wn(3440

: error 010: invalid function or declaration
C:\Documents and Settings\Gabriel\Desktop\PAWNO\PROJECTS\GAMEMODE.p wn(34411) : error 021: symbol already defined: "GetPlayerHealth"
x.x
nгo tem como fazer tipo um FS pronto?
ai ja seria pedido neh? ;s
mas se der faz pra mim? sу preciso disso pra acabar meu projeto
As linhas estгo:
34404 public VidaDescer();
34405 {
34406 for(new i = 0; i < MAX_PLAYERS; i++)
34407 {
34408 if(IsPlayerConnected(i))
34409 {
34410 new Float:health;
34411 GetPlayerHealth(playerid, vida);
34412 SetPlayerHealth(playerid, vida - 1);
34413 }
34414 }
34415 }
(coloquei os numeros so pra mostrar onde fica cada linha,
e o forum tira alguns espaзos do script)
edit:
jб arrumei...
nao vi o ";"
dps do public
valeu ai
testando...
Re: [DUV] Sistema de Retirar Vida de Todos -
Dr_Pawno - 19.08.2010
baixa aki o
http://rapidshare.com/files/413971439/Vida.RAR