SA-MP Forums Archive
How To Script Virus System Command - 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: How To Script Virus System Command (/showthread.php?tid=548054)



How To Script Virus System Command - ohmy - 27.11.2014

Hello.

Can you tell me how to create a Virus system command?
like set every second. the player health decrease -5, and, for 15 second, the virus is gone and player health doesnt decrease again
if you can, please use zcmd, i use zcmd in my script


Re: How To Script Virus System Command - SWAT4 - 27.11.2014

How Do You Want The Virus to be set?
Command Or Something? or CheckpoinT?


Re: How To Script Virus System Command - ohmy - 27.11.2014

Quote:
Originally Posted by SWAT4
Посмотреть сообщение
How Do You Want The Virus to be set?
Command Or Something? or CheckpoinT?
Command, and then the virus decrease all the player health


Re: How To Script Virus System Command - SWAT4 - 27.11.2014

Try this :
http://pastebin.com/f8393df9
Its as a Infecting / curing Command ..With DCMD but not big deal cuz its FS


Re: How To Script Virus System Command - ohmy - 27.11.2014

sorry, but any other code, because thats not efficient


Re: How To Script Virus System Command - Sparke - 27.11.2014

Make a timer that deducts the player HP in X amount of seconds


Re: How To Script Virus System Command - ohmy - 27.11.2014

can you pastebin the code?


AW: How To Script Virus System Command - Nero_3D - 27.11.2014

Basic repeating callback
pawn Код:
forward RepetitiveHeal(interval, Float: heal, tic);
public RepetitiveHeal(interval, Float: heal, tic) {
    if(0 < tic) {
        new
            Float: health
        ;
        for(new i; i != MAX_PLAYERS; ++i) { // use foreach if you have it
            if(GetPlayerHealth(i, health)) {
                SetPlayerHealth(i, health + heal);
            }
        }
        SetTimerEx("RepetitiveHeal", interval, false, "ifi", interval, heal, tic - 1);
    }
}
Call it like any other function, in your case
pawn Код:
cmd_virus(playerid, params[]) {
    #pragma unused params
    // all 1000 ms, -5.0 health each time, 15 times
    RepetitiveHeal(1000, -5.0, 15);
    return true;
}



Re: How To Script Virus System Command - ohmy - 28.11.2014

what code should i put in OnGameModeInit?


Re: How To Script Virus System Command - Glossy42O - 28.11.2014

underit i guess..