Imortal Vehicle & People problem
#1

Im makeing a stunt server ( this is the 3th time i change gamemode XD ) so
id like that you cant die and your vehicle cant
i tried this ( i have alot 3 000 lines in my gamemode im not saying em!) :
[pawn]
// This is at the top of the gamemode
#include <a_samp>
// STUNT - FUNCTIONS
forward ImortalVehicle(playerid,vehicleid);
forward ImortalPerson(playerid);

public ImortalVehicle();
{
new Float:HP;
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerInAnyVehicle(i))
{
for(new v=0;v<MAX_VEHICLES;v++)
{
GetVehicleHealth(v,Float:HP);
if(Float:HP < 1000)
{
SetVehicleHealth(v,1000);
}
}
}
}
}

public ImortalPerson();
{
new Float:HP;
for(new i=0;i<MAX_PLAYERS;i++)
{
if (GetPlayerHealth(i) < 100)
{
SetPlayerHealth(i, 100);
}
}
}

[pawn]

after the forwards i have set the timers :
pawn Код:
SetTimer(ImortalPerson,100,true);
SetTimer(ImortalVehicle,100,true);
when i got ingame ( i set this for a test ) :
pawn Код:
public OnPlayerSpawn(playerid)
{
   SetPlayerHealth(playerid,1);
   return 1;
}
compiled succesfully
it didnt work
i tryed to add the timers in OnGameModeInit :

pawn Код:
public OnGameModeInit()
{
   SetTimer(ImortalPerson,100,true);
   SetTimer(ImortalVehicle,100,true);
   return 1;
}
i got some errors in OnGameModeInit

Код:
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(110) : error 017: undefined symbol "ImortalPerson"
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(111) : error 017: undefined symbol "ImortalVehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
put it didnt work with the not in gamemodeinit

however

i understood these errors but this is what i got when i puted the public functions at the end of my script
Код:
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(80) : error 076: syntax error in the expression, or invalid function call
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(81) : error 076: syntax error in the expression, or invalid function call
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1508) : error 055: start of function body without function header
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1510) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1512) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1514) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1517) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1527) : error 055: start of function body without function header
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1528) : error 021: symbol already defined: "HP"
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1529) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1531) : error 010: invalid function or declaration
C:\Users\Mihailo\Desktop\Script Test Server\gamemodes\gm.pwn(1538) : warning 203: symbol is never used: "HP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


11 Errors.
anyone please help me i wood apruciate it
Reply


Messages In This Thread
Imortal Vehicle & People problem - by Micko9 - 31.01.2010, 11:41
Re: Imortal Vehicle & People problem - by smeti - 31.01.2010, 11:44
Re: Imortal Vehicle & People problem - by Micko9 - 31.01.2010, 11:53
Re: Imortal Vehicle & People problem - by Finn - 31.01.2010, 12:03
Re: Imortal Vehicle & People problem - by Micko9 - 31.01.2010, 12:08
Re: Imortal Vehicle & People problem - by Finn - 31.01.2010, 12:19
Re: Imortal Vehicle & People problem - by Micko9 - 31.01.2010, 12:20
Re: Imortal Vehicle & People problem - by Finn - 31.01.2010, 12:22
Re: Imortal Vehicle & People problem - by Nakash - 31.01.2010, 12:24
Re: Imortal Vehicle & People problem - by Micko9 - 31.01.2010, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)