A prob with a command..
#2

A few things:

1) You can set the bool to either true or false in the define line itself instead of "falsing" it right after.
2) No need to set the reloading bool to true INSIDE the loop, better to place that right after.
3) In commands/loops/etc you can also if(variable) INCASE it's a boolean, instead of if(variable == true), for false you can use if(!variable) instead of if(reloading == false).
4) I guess you forgot to define the pName variable(?)
4) I guess you forgot to define the string variable(?) - AVOID from using strings that are more than 124 bits.
5) I narrowed the whole code as I like in order to provide you a better answer.

PHP код:
new bool:reloading false;
public 
reload()
{
     
GameTextForAll("The cannon has been reloaded.",2000,4);
     
SetObjectPos(obj 268.8999938964818849);
     return 
1;
}
public 
fifteen()
{
     for(new 
0MAX_PLAYERSi++)
     {
          if(
IsPlayerInRangeOfPoint(i500.0268.8999938964818849))
          {
               
GameTextForPlayer(,"~r~15 secs until launch",2000,4);
               
PlayerPlaySound(32000.00.00.0);
          }
     }
     
reloading true;
     return 
1;
}
if (
strcmp("/launch"cmdtexttrue10) == 0)
{
     new 
pName[MAX_PLAYER_NAME];
     new 
string[124];
     if(
reloading)
     {
          
SendClientMessage(playeridCOLOR_LIGHTBLUE"The cannon is reloading.. please wait.");
     }
     else
     {
          
SetTimer("reload"1200000);
          
SetTimer("fifteen"10000);
          
SetTimer("ten"50000);
          
SetTimer("five"100000);
          
SetTimer("four"110000);
          
SetTimer("three"120000);
          
SetTimer("two"130000);
          
SetTimer("one"140000);
          
SetTimer("start"150000);
     }
     
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
     
format(stringsizeof(string), "{00CDCD}%*s {00FFFF}started the cannon countdown."pName);
     
SendClientMessageToAll(COLOR_LIGHTBLUEstring);
     return 
1;

Reply


Messages In This Thread
A prob with a command.. - by Steezy_ - 04.07.2013, 16:05
Re: A prob with a command.. - by Income - 04.07.2013, 16:49
Re: A prob with a command.. - by Steezy_ - 04.07.2013, 17:41

Forum Jump:


Users browsing this thread: 1 Guest(s)