>>Help<<
#1

Hello I've this in mine command, When I type /dm15 for ex. It will show a textdraw for 12 seconds. But if I type another command ex. /dm14 everything is ok the text will change to but the timer set not again,

You know what I mean?
No? I type /dm15 timer will count 12 seconds but when i type /dm14 ex. inside the 12 seconds the timer will not count again from 0 And so is there a problem like The textdraw show ex. 5 seconds. Or something else.

My command.

Код:
if(!strcmp(cmd, "/dm15", true))
{
	ResetPlayerWeapons(playerid);
	SetPlayerInterior(playerid, 0);
	GivePlayerWeapon(playerid, 9, 1);
	SetPlayerHealth(playerid, 100.0);
	SetPlayerPos(playerid, -924.0569, 2675.6586, 42.3703);
	GetPlayerName(playerid, var0, 25);
	format(var1, 256, "%s DM15'e (Testere) gecis yapti(/dm15).", var0);
	TextDrawSetString(Text:Bilgi,var1);
	TextDrawShowForAll(Text:Bilgi);
	SetTimer("Silici",12000,0);
	return 1;
}
Reply
#2

easy to do
create a bool
then when the player types the cmd change the bool to true
then when he typr the cmd check if the bol is false
try this
pawn Код:
// add this in the top of the scrit
new bool:tCmd[MAX_PLAYERS];
// then this is your cmd
if(!strcmp(cmd, "/dm15", true))
{
if(tCmd[playerid] == false)
{  
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0);
GivePlayerWeapon(playerid, 9, 1);
SetPlayerHealth(playerid, 100.0);
SetPlayerPos(playerid, -924.0569, 2675.6586, 42.3703);
GetPlayerName(playerid, var0, 25);
format(var1, 256, "%s DM15'e (Testere) gecis yapti(/dm15).", var0);
TextDrawSetString(Text:Bilgi,var1);
TextDrawShowForAll(Text:Bilgi);
SetTimerEx("Silici",12000,0, "i", playerid); // here try "SetTimerEx" it's better and it juste hide the text for player
tCmd[playerid] = true;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You cannot type a dm command again before 12 seconds !");
}
return 1;
}

// this is what you have to put in the timer
public Silici(playerid)
{
// bla bla bla(your script functions
tCmd[playerid] = false;
return 1;
Reply
#3

Quote:
Originally Posted by ► James_Alex
easy to do
create a bool
then when the player types the cmd change the bool to true
then when he typr the cmd check if the bol is false
try this
pawn Код:
// add this in the top of the scrit
new bool:tCmd[MAX_PLAYERS];
// then this is your cmd
if(!strcmp(cmd, "/dm15", true))
{
if(tCmd[playerid] == false)
{  
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0);
GivePlayerWeapon(playerid, 9, 1);
SetPlayerHealth(playerid, 100.0);
SetPlayerPos(playerid, -924.0569, 2675.6586, 42.3703);
GetPlayerName(playerid, var0, 25);
format(var1, 256, "%s DM15'e (Testere) gecis yapti(/dm15).", var0);
TextDrawSetString(Text:Bilgi,var1);
TextDrawShowForAll(Text:Bilgi);
SetTimerEx("Silici",12000,0, "i", playerid); // here try "SetTimerEx" it's better and it juste hide the text for player
tCmd[playerid] = true;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You cannot type a dm command again before 12 seconds !");
}
return 1;
}

// this is what you have to put in the timer
public Silici(playerid)
{
// bla bla bla(your script functions
tCmd[playerid] = false;
return 1;
Thank you..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)