commands not working
#1

My commands in the server is'nt working i do them and it says SERVER:Unknown command
but it compiles fine with no errors,but only 4 warnings which dont mean anything
heres the code

Код:
public OnPlayerCommandText (playerid,cmdtext[])
{
  if strcmp(cmdtext,"/smbase",true, 0) *then
	{
	SetPlayerPos(playerid,-2157.7058,-197.5349,35.3203);
  SendClientMessage(playerid,TEXT_COLOR, "Welcome to the SM Base");
	return 1;
	}
  if strcmp(cmdtext,"/kill",true, 1) *then
	{
	SetPlayerHealth(playerid, 0);
  return 1;
	}
    return 0;

}
Reply
#2

Sorry 2 errors, im not sure whats wrong

Код:
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(90) : warning 217: loose indentation
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(96) : warning 217: loose indentation
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(139) : error 001: expected token: "*then", but found "{"
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(142) : warning 217: loose indentation
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(145) : error 001: expected token: "*then", but found "{"
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(147) : warning 217: loose indentation
C:\Users\USER\Documents\Josh's Documents\GTA San Andreas\samp\gamemodes\trest.pwn(222) : warning 203: symbol is never used: "gteam"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#3

Oh how do i indent
Reply
#4

Bad (loose) Indentation:

Код:
public OnPlayerCommandText (playerid,cmdtext[])
{
 if(strcmp(cmdtext, "/smbase", true) == 0)
{
    SetPlayerPos(playerid,-2157.7058,-197.5349,35.3203);
  SendClientMessage(playerid,TEXT_COLOR, "Welcome to the SM Base");
 return 1;
    }
 if(strcmp(cmdtext, "/kill", true) == 0)
  {
SetPlayerHealth(playerid, 0);
        return 1;
    }
   return 0;
 }
Good Indentation

Код:
public OnPlayerCommandText (playerid,cmdtext[])
{
  if(strcmp(cmdtext, "/smbase", true) == 0)
  {
    SetPlayerPos(playerid,-2157.7058,-197.5349,35.3203);
    SendClientMessage(playerid,TEXT_COLOR, "Welcome to the SM Base");
    return 1;
  }
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
    SetPlayerHealth(playerid, 0);
    return 1;
  }
  return 0;
}
@Andre, you're right, its
Код:
#pragma tabsize 0
to let pawno ignore Indentation

Reply
#5

Ok thanks
Reply
#6

Quote:

Default space is 4 " "(space) in PAWNO program...
You can disable the warnings(not recommended by me, for sure) - #pragma tabsize 0 (or was it 1, don't remember)

Indenting it correctly makes it easily readable

Dude... Just press TAB For 4 Spaces.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)