11.11.2011, 11:48
how i can make /help to setplayer HP and armour to 100 but the command to can use every 2 minutes
SetTimerEx
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;
}
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;
}
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;
}