help with /heal
#1

how i can make /help to setplayer HP and armour to 100 but the command to can use every 2 minutes
Reply
#2

use
pawn Код:
SetTimerEx
Reply
#3

but how i make this but i have pawno is crashing
PHP код:
if(strcmp(cmd,"/heal",true)==0)
    {
        if(
PlayerInfo[playerid][pDonateRank] >= 4)
        {
        if(
GetTickCount() - GetPVarInt(playerid"heal") < 120000) return SendClientMessage(playerid0xFF0000FF"you must wait 2 minutes");
                 
SetPlayerHealth(playerid100);
                 
SetPlayerArmour(playerid100);
                
SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
                    
SetPVarInt(playerid"heal"GetTickCount());
                
            }
        }
         return 
1;
    } 
Reply
#4

Maybe because you have an extra bracket?
pawn Код:
if(strcmp(cmd,"/heal",true)==0)
    {
        if(PlayerInfo[playerid][pDonateRank] >= 4)
        {
        if(GetTickCount() - GetPVarInt(playerid, "heal") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you must wait 2 minutes");
                 SetPlayerHealth(playerid, 100);
                 SetPlayerArmour(playerid, 100);
                SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
                    SetPVarInt(playerid, "heal", GetTickCount());
               
            }  /* <-------------------- */
        }
         return 1;
    }
Reply
#5

again crash wheen i delete the command the gamemode is compile
Reply
#6

Here you go.

pawn Код:
if(strcmp(cmd,"/heal",true)==0)
    {
        if(PlayerInfo[playerid][pDonateRank] >= 4)
        {
           if(GetTickCount() - GetPVarInt(playerid, "heal") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "you must wait 2 minutes");
           SetPlayerHealth(playerid, 100);
           SetPlayerArmour(playerid, 100);
           SendClientMessage(playerid,COLOR_GREEN,"You've set your health and armour to 100");
           SetPVarInt(playerid, "heal", GetTickCount());
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)