hello thx for help in my heal cmd time but as u told me that lastu thing
i need to use this type of timer in my heal cmd too but it says symbol already defined which is in now in my kill cmd so i wanna ask can i use that single lastu in both of the cmds or it will be messed up?here are my codes of both cmds
and if yes it will be messed so how can i seprate both of them??
pls helpppp plsss
Code:
new lastu[MAX_PLAYERS];
CMD:kill(playerid, params[])
{
if ((gettime() - lastu[playerid]) < (5)) return SendClientMessage(playerid, 0xFFFFFF, "Why are you so sad by you life wait few seconds more to sucide again!");
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, 0xFFFFFF, "You took a easy way out!");
return 1;
}
PHP Code:
new lastu[MAX_PLAYERS];
CMD:kill(playerid, params[])
{
if ((gettime() - lastu[playerid]) < (5)) return SendClientMessage(playerid, 0xFFFFFF, "Why are you so sad by you life wait few seconds more to sucide again!");
SetPlayerHealth(playerid, 0);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, 0xFFFFFF, "You took a easy way out!");
return 1;
}
CMD:heal(playerid, params[])
{
if((gettime() - lastu[playerid]) < (60*5)) return SendClientMessage(playerid,-1,"You need wait 5 minuts.");
if (GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "Booooo you dont have money!! Poor guy lololol!");
lastu[playerid] = gettime();
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -5000);
return 1;
}
pls helpppp plsss