SA-MP Forums Archive
weather 18 geting health - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: weather 18 geting health (/showthread.php?tid=589939)



weather 18 geting health - Auri - 24.09.2015

Hallo i need script to weather whith geting player HP.

Who help me?


Re: weather 18 geting health - jlalt - 24.09.2015

Quote:
Originally Posted by Auri
Посмотреть сообщение
Hallo i need script to weather whith geting player HP.

Who help me?
can you explean more?


Re: weather 18 geting health - Auri - 24.09.2015

Weather witch geting health i set weather sandstorm and this weather take player HP - 30

30 SEC = -10 HP


AW: weather 18 geting health - Kaliber - 24.09.2015

You have to make a timer:

PHP код:
//@top of the script:
new weather;
//OnGameModeInit
SetTimer(!"@weather",1000*30,1);
//When you set weather:
weather 18//for example
SetWeather(weather);
//Then in the callback
@weather();@weather() {
    switch(
weather) {
        case 
18: {
            const 
Float:dmg 10.0//for example 10 Hp every 30sec
            
for(new i=GetPlayerPoolSize()+1,Float:h; --i!=-1; )
            {
                if(!
IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
                
GetPlayerHealth(i,h),SetPlayerHealth(i,h-dmg);
            }
        }
    }
    return 
1;