Need Help with my health Regeneration script :(
#1

i wanna execute a command that will make health regenerate by +1 and kill the timer after like 1min
here is my failure script :

dcmd_takedrugs(playerid, params[])
(
new amount,
string[200];
new FloatHealth;
if (sscanf(params, "500", amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /takedrugs [amount]");
else if (amount > PlayerInfo[playerid][pBag]) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Drugs");
{
hp[ playerid ] = SetTimerEx("HPreg", 1000, 1, "i", playerid);
GetPlayerHealth(hp[ playerid], pHealth);
if(pHealth < 100) SetPlayerHealth(hp[ playerid], pHealth +1);
(
if(pHealth < 30) GameTextForPlayer(hp[ playerid],"~r~Find some cover before taking more damage!",3000,3); // announcing that you have low health while regenerating
(
if(pHealth > 100) SetPlayerHealth(hp[ playerid], 100);
KillTimer(hp[ playerid] );
PlayerInfo[playerid][pBag] -= amount;
SendClientMessage(playerid, COLOR_YELLOW, string);
SendClientMessage(playerid, 0x00FF00AA, "Your On Drugs");
}
return 1;
}

And here is the errors
:


G:\Documents and Settings\Administrator\Desktop\ftp Server\pawno\CNR.pwn(9944 -- 9945) : error 029: invalid expression, assumed zero
G:\Documents and Settings\Administrator\Desktop\ftp Server\pawno\CNR.pwn(9943) : error 010: invalid function or declaration
G:\Documents and Settings\Administrator\Desktop\ftp Server\pawno\CNR.pwn(9943 -- 9949) : error 010: invalid function or declaration
G:\Documents and Settings\Administrator\Desktop\ftp Server\pawno\CNR.pwn(9943 -- 9949) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)