/heal help
#1

can someone make me the command to setplayer hp and armor to 100 and each player to can use it 1 time in 2 minutes
Reply
#2

pawn Код:
new
    HealUsed[ MAX_PLAYERS ]
;


forward @RefreshCmd( playerid );

@RefreshCmd( playerid )
{
    HealUsed[ playerid ] = 0;
    SendClientMessage( playerid, -1, #two minutes passed you can now use heal command );
}

CMD:heal( playerid, params[] )
{  
    if ( HealUsed[ playerid ] == 1 ) return SendClientMessage( playerid, -1, #you cannot use this command, 2 minutes not passed );
    SetPlayerHealth( playerid, 100 );
    SetPlayerArmour( playerid, 100 );
    HealUsed[ playerid ] = 1;
    SetTimerEx( "RefreshCmd", 120000, false, "i", playerid );
   
    return ( 1 );
}
Reply
#3

can we make it more easy
Reply
#4

What command system are you using? I use dcmd so...

pawn Код:
new pHealTime[MAX_PLAYERS];

dcmd_heal(playerid, params[])
{
    #pragma unused params
    if(gettime()-pHealTime[playerid] < 120) return SendClientMessage(playerid, COLOR_RED, "You can only heal once every 2 minutes.");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    pHealTime[playerid] = gettime();
    return 1;
}
Not tested.
Reply
#5

Код:
if(strcmp, "/heal", cmd, true, 10) == 0)
    {
         SetPlayerHealth(playerid, 100); // You can also edit the health healing here
         SetPlayerArmour(playerid, 100);//You can also edit the armour healing here
         SendClientMessage(playerid, [COLORHERE], "You have healed yourself.");
         return 1;
not tested
Reply
#6

Try reading the thread first.
Quote:
Originally Posted by boyan96
Посмотреть сообщение
can someone make me the command to setplayer hp and armor to 100 and each player to can use it 1 time in 2 minutes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)