13.06.2011, 13:27
I have to create all players get +10 health in every 3 secs can anyone give me script? please..
forward Health();//top of script
SetTimer("Health",3000,true);//In GamemodeInt
public Health()//Give this where you want but i am giving under OnPlayerClickPlayer
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerHealth(i,10+);
}
}
return 1;
}
forward message(); public OnGameModeInit() { print("Starting timer..."); SetTimer("message", 1000, false); // Set a timer of 1000 miliseconds (1 second) } public message() { print("1 second has passed."); } |
C:\......\samp03csvr_R2-2_win32\gamemodes\HellzoneStuntages.pwn(3360) : error 029: invalid expression, assumed zero C:\......\samp03csvr_R2-2_win32\gamemodes\HellzoneStuntages.pwn(3360) : error 001: expected token: ",", but found ";" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Line No. 3360 : SetPlayerHealth(i,10+);
// I'll make it as a filterscript.
public OnFilterScriptInit( )
{
SetTimer( "regenHealth", 3000, true );
return 1;
}
forward regenHealth( ); public regenHealth( )
{
for ( new slots = GetMaxPlayers( ), i; i < slots; i ++ )
{
if ( !IsPlayerConnected( i ) ) continue;
new Float: iHealth;
GetPlayerHealth( i, iHealth );
SetPlayerHealth( i, iHealth + 10.0 );
}
return 1;
}
SetPlayerHealth(i,10+);
SetPlayerHealth(i,+10);
SetPlayerHealth(i,10+);