10.04.2010, 10:21
So here is my problem.
I made a command so that the player can use it once in 1 minute.
When there are 2 players, the speed of the textdraw doubles, goes 2x faster, only if we both use the command.
So here i'm going to show you my code.
It's a pretty long command, but i'm going to show you where the problem is...
My problem is betwen the comented lines....
Oh and here is the textdraw:
I know its a long code, but i beg you to don't just tae a look and if it's too big u'll go away.
Help
BTW, pawn codes fcked up identation...
I made a command so that the player can use it once in 1 minute.
When there are 2 players, the speed of the textdraw doubles, goes 2x faster, only if we both use the command.
So here i'm going to show you my code.
It's a pretty long command, but i'm going to show you where the problem is...
pawn Код:
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;
}
Oh and here is the textdraw:
pawn Код:
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;
}
Help
BTW, pawn codes fcked up identation...