/count i got some bugs
#1

im doign a /count command, i think ive got it down, but i just got some errors i need help with

The script
Код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
forward count2();
forward count1();
forward countgo();
forward stop();
new bool:a;
new Float:x, Float:Y, Floats:z;
#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/count",true) == 0) {
	new pName[30];
	new string[256];
	if (a == false)
	{
	a = true;
  GetPlayerName(playerid, pName, 30);
	format(string, 280, "*** %s started to count.", pName);
 	SendClientMessageToAll(COLOR_MEDIUMSLATEBLUE, string);
  for(new i; i < MAX_PLAYERS; i++) {
  GameTextForPlayer (i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
  GetPlayerPos(i,X,Y,Z);
	}
	SetTimer("count2",1000,0);
	SetTimer("count1",2000,0);
	SetTimer("countgo",3000,0);
 	SetTimer("stop",6000,0);
}
 else SendClientMessage(playerid, 0x7B68EEFF, "Your Already Counting!");
 return 1;
 }

 return 0;
}
////////////////////////////////////////////////////////////////////////////////
public count2()
{
	for(new i; i < MAX_PLAYERS; i++) {
	GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3);
	GetPlayerPos(i,X,Y,Z);
	}
}
////////////////////////////////////////////////////////////////////////////////
public count1()
{
	for(new i; i < MAX_PLAYERS; i++) {
	GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3);
	GetPlayerPos(i,X,Y,Z);
	}
}
////////////////////////////////////////////////////////////////////////////////
public countgo()
{
	for(new i; i < MAX_PLAYERS; i++) {
	GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ Go! ~g~-",1000,3);
	GetPlayerPos(i,X,Y,Z);
	}
}
public stop()
{
	a = false;
}
The errors
C:\Documents and Settings\Robin\Desktop\Counting.pwn(27) : error 017: undefined symbol "X"
C:\Documents and Settings\Robin\Desktop\Counting.pwn(34) : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(35) : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(3 : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(45) : error 017: undefined symbol "X"
C:\Documents and Settings\Robin\Desktop\Counting.pwn(53) : error 017: undefined symbol "X"
C:\Documents and Settings\Robin\Desktop\Counting.pwn(61) : error 017: undefined symbol "X"
C:\Documents and Settings\Robin\Desktop\Counting.pwn(72) : warning 203: symbol is never used: "x"
C:\Documents and Settings\Robin\Desktop\Counting.pwn(72) : warning 203: symbol is never used: "z"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#2

The Pawn manual

Pawn is case sensitive.
Reply
#3

I know, Im finding it difficult to adjust to not starting with lowercase, or in mid sentence going to upper case.

Ok sorted now i got this

C:\Documents and Settings\Robin\Desktop\Counting.pwn(27) : warning 213: tag mismatch
C:\Documents and Settings\Robin\Desktop\Counting.pwn(34) : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(35) : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(3 : warning 217: loose indentation
C:\Documents and Settings\Robin\Desktop\Counting.pwn(45) : warning 213: tag mismatch
C:\Documents and Settings\Robin\Desktop\Counting.pwn(53) : warning 213: tag mismatch
C:\Documents and Settings\Robin\Desktop\Counting.pwn(60) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Warnings.

with this code
Код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
forward count2();
forward count1();
forward countgo();
forward stop();
new bool:a;
new Float:X, Float:Y, Floats:Z;
#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/count",true) == 0) {
	new pName[30];
	new string[256];
	if (a == false)
	{
	a = true;
  GetPlayerName(playerid, pName, 30);
	format(string, 280, "*** %s started to count.", pName);
 	SendClientMessageToAll(COLOR_MEDIUMSLATEBLUE, string);
  for(new i; i < MAX_PLAYERS; i++) {
  GameTextForPlayer (i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
  GetPlayerPos(i,X,Y,Z);
	}
	SetTimer("count2",1000,0);
	SetTimer("count1",2000,0);
	SetTimer("countgo",3000,0);
 	SetTimer("stop",6000,0);
}
  else SendClientMessage(playerid, 0x7B68EEFF, "Your Already Counting!");
  return 1;
  }

  return 0;
}
////////////////////////////////////////////////////////////////////////////////
public count2()
{
  for(new i; i < MAX_PLAYERS; i++) {
  GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3);
  GetPlayerPos(i,X,Y,Z);
  }
}
////////////////////////////////////////////////////////////////////////////////
public count1()
{
  for(new i; i < MAX_PLAYERS; i++) {
  GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3);
  GetPlayerPos(i,X,Y,Z);
  }
}
////////////////////////////////////////////////////////////////////////////////
public countgo()
{
  for(new i; i < MAX_PLAYERS; i++) {
  GetPlayerPos(i,X,Y,Z);
  GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~START~g~-~y~]~g~-",1000,3);
   }
}
public stop()
{
  a = false;
}
Reply
#4

Quote:

Floats



Just click the link in my previous post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)