24.09.2015, 10:36
Hallo i need script to weather whith geting player HP.
Who help me?
Who help me?
//@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;
}