How To Script Virus System Command
#1

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
Reply
#2

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

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
Reply
#4

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

sorry, but any other code, because thats not efficient
Reply
#6

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

can you pastebin the code?
Reply
#8

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;
}
Reply
#9

what code should i put in OnGameModeInit?
Reply
#10

underit i guess..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)