Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

2 cmds by one ""new lastu[MAX_PLAYERS];"" possible?

$
0
0
hello thx for help in my heal cmd time but as u told me that lastu thing
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;
}

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
PHP Code:

new lastu[MAX_PLAYERS];

CMD:kill(playeridparams[])
{
    if ((
gettime() - lastu[playerid]) < (5)) return SendClientMessage(playerid0xFFFFFF"Why are you so sad by you life wait few seconds more to sucide again!");
    
SetPlayerHealth(playerid0);
    
GivePlayerMoney(playerid, -5000);
    
SendClientMessage(playerid0xFFFFFF"You took a easy way out!");
    return 
1;
}

CMD:heal(playeridparams[])
{
    if((
gettime() - lastu[playerid]) < (60*5)) return SendClientMessage(playerid,-1,"You need wait 5 minuts.");
    if (
GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid0xFFFFFF"Booooo you dont have money!! Poor guy lololol!");
    
lastu[playerid] = gettime();
    
SetPlayerHealth(playerid100);
    
GivePlayerMoney(playerid, -5000);
    return 
1;


and if yes it will be messed so how can i seprate both of them??
pls helpppp plsss

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>