Errors with a command.
#1

pawn Код:
new playerb, string[128];
            format(string,50,"%d.%d",array[0],array[1]); - THS IS THE ONE THAT IS GIVING ME PROBLEMS.
            new sendername[MAX_PLAYER_NAME];
            new tmp[128], idx, cmd[128];
            tmp = strtok(params, idx);
            if(!strlen(tmp))
ERRORS:
Quote:

C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(2592) : warning 235: public function lacks forward declaration (symbol "PlayerToPoint")
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(8435) : warning 217: loose indentation
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(8441) : warning 217: loose indentation
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13562) : warning 217: loose indentation
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13563) : error 017: undefined symbol "array"
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13563) : warning 215: expression has no effect
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13563) : error 001: expected token: ";", but found "]"
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13563) : error 029: invalid expression, assumed zero
C:\Users\Grant\Desktop\GGNGS\GGN - SAMP\gamemodes\ZRP.pwn(13563) : fatal error 107: too many error messages on one line

Reply
#2

First off all you need to forward the function PlayerToPoint by putting this somewhere in your code:

pawn Код:
forward PlayerToPoint(playerid, Float:x, Float:y, Float:z); //the syntax may differ - make sure it matches the line public PlayerToPoint
To fix the loose indentation warnings: Look up indentation - what it is and why you should use it.

---

Now for the errors.

The variable "array" is not defined, thus giving you the "undefined symbol" error. You need to define it by putting, e.g.
pawn Код:
new array[max_value]; //replace max_Value with the actual max value
This should basically fix all your errors - if not, reply with the remaining ones.
Reply
#3

Also, you declared the string size as '128' while you typed 50 in the format line?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)