if(strcmp(cmd, "/HEAL", true) == 0)
{
if(GetPlayerRank(playerid) == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command.Low rank!");
}
if(GetPlayerRank(playerid) == 1)
{
if(DMzone[playerid] == 0)
{
if (GetPlayerMoney(playerid) >= 2000)
{
new Float:HHEALTH;
GivePlayerMoney(playerid, -2000);
GetPlayerHealth(playerid, HHEALTH);
SetPlayerHealth(playerid, HHEALTH+50);
GameTextForPlayer(playerid, "~g~Healed~w~!~n~~r~-~y~2~w~.~y~000~g~$",2000,1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need atleast 2.000$");
}
}
if(DMzone[playerid] == 1)
{
if (GetPlayerMoney(playerid) >= 5000)
{
if(HEALTHTIMER[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "This command can be used again after 1 minute");
return 1;
}
/////////////////////////////////////////////////////////////////////////////
new Float:HHEALTH;
GetPlayerHealth(playerid, HHEALTH);
SetPlayerHealth(playerid, HHEALTH+50);
GameTextForPlayer(playerid, "~g~~h~Healed~w~!", 3000, 1);
//SetTimerEx("NewbieH", 60000, false, "i", playerid);//1 MINUTES
CountDownTrue = 1;
CountDownMinutes = 1; //in minutes
CountDownSeconds = 1; //in seconds
HEALTHTIMER[playerid] = 1;
format(string, sizeof(string), "%d:%d", CountDownMinutes, CountDownSeconds);
TextDrawSetString(Text:CountText2, string);
TextDrawShowForPlayer(playerid,CountText2);
SetTimer("CountDownTimer", 1000, 0);
/////////////////////////////////////////////////////////////////////////////
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need atleast 5.000$.");
}
}
}
if(GetPlayerRank(playerid) == 2)
{
if(DMzone[playerid] == 0)
{
new Float:UBHealth;
GetPlayerHealth(playerid, UBHealth);
SetPlayerHealth(playerid, UBHealth+50);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This command can be used only in Stunt Zones.");
}
}
return 1;
}
public CountDownTimer(playerid)
{
if (CountDownTrue == 1)
{
CountDownSeconds--;
if (CountDownSeconds == 0)
{
CountDownSeconds = 60;
if (CountDownMinutes == 0)
{
CountDownTrue = 0;
TextDrawHideForPlayer(playerid, CountText2);
HEALTHTIMER[playerid] = 0;
}
CountDownMinutes--;
}
new string[256];
format(string, sizeof(string), "%d:%d", CountDownMinutes, CountDownSeconds);
TextDrawSetString(Text:CountText2, string);
SetTimer("CountDownTimer", 1000, 0);
return 1;
}
return 1;
}
new CountDownSeconds;
new CountDownSeconds[MAX_PLAYERS];
CountDownSeconds[playerid]--;
public CountDownTimer(playerid)
{
if (CountDownTrue == 1)
{
CountDownSeconds[playerid]--;
if (CountDownSeconds == 0)
{
CountDownSeconds = 60;
if (CountDownMinutes == 0)
{
CountDownTrue = 0;
TextDrawHideForPlayer(playerid, CountText2);
HEALTHTIMER[playerid] = 0;
}
CountDownMinutes--;
}
new string[256];
format(string, sizeof(string), "%d:%d", CountDownMinutes, CountDownSeconds);
TextDrawSetString(Text:CountText2, string);
SetTimer("CountDownTimer", 1000, 0);
return 1;
}
return 1;
}
if(HEALTHTIMER[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "This command can be used again after 1 minute");
return 1;
}
new Float:HHEALTH;
GetPlayerHealth(playerid, HHEALTH);
SetPlayerHealth(playerid, HHEALTH+50);
GameTextForPlayer(playerid, "~g~~h~Healed~w~!", 3000, 1);
//SetTimerEx("NewbieH", 60000, false, "i", playerid);//1 MINUTES
CountDownTrue = 1;
CountDownMinutes[playerid] = 1; //in minutes
CountDownSeconds[playerid] = 1; //in seconds
HEALTHTIMER[playerid] = 1;
format(string, sizeof(string), "%d:%d", CountDownMinutes[playerid], CountDownSeconds[playerid]);
TextDrawSetString(Text:CountText2, string);
TextDrawShowForPlayer(playerid,CountText2);
SetTimer("CountDownTimer", 1000, 0);
}
public CountDownTimer(playerid)
{
if (CountDownTrue == 1)
{
CountDownSeconds[playerid]--;
if (CountDownSeconds[playerid] == 0)
{
CountDownSeconds[playerid] = 60;
if (CountDownMinutes[playerid] == 0)
{
CountDownTrue = 0;
TextDrawHideForPlayer(playerid, CountText2);
HEALTHTIMER[playerid] = 0;
}
CountDownMinutes[playerid]--;
}
new string[256];
format(string, sizeof(string), "%d:%d", CountDownMinutes[playerid], CountDownSeconds[playerid]);
TextDrawSetString(Text:CountText2, string);
SetTimer("CountDownTimer", 1000, 0);
return 1;
}
return 1;
}
Originally Posted by PlayON
Done what you told me.
This is how it looks like now... COMMAND: pawn Код:
pawn Код:
do i have to do MAX_PLAYERS with CountDownTrue too? |
Originally Posted by PlayON
http://pastebin.com/DfqbRaK8
Here is, i put things togheter, if you need something else in it, tell me If you solve my problem, u'll be in credits, twice, coz i use your Transmission xD |
Originally Posted by » RyDeR «
Quote:
I'll post here. |