SA-MP Forums Archive
4 warnings - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 4 warnings (/showthread.php?tid=96958)



4 warnings - Chrham_2 - 11.09.2009

C:\Users\*****\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\mtrp-final.pwn(2853 : warning 217: loose indentation
C:\Users\*****\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\mtrp-final.pwn(28540) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\*****\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\mtrp-final.pwn(28541) : warning 217: loose indentation
C:\Users\*****\Desktop\samp\Chrham's RPG\samp02Xserver.win32\gamemodes\mtrp-final.pwn(28546) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 warnings.

Source:

if(strcmp(cmdtext,"/coords",true) == 0)
{
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;


Re: 4 warnings - Correlli - 11.09.2009

Local variable's name is the same as global one, change the name for one of them and all related things to them and indent your code.


Re: 4 warnings - dice7 - 11.09.2009

And for the other errors
http://forum.sa-mp.com/index.php?topic=61893.0


Re: 4 warnings - [XST]O_x - 11.09.2009

your code:
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
You need:
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
you had an extra space in
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;



Re: 4 warnings - Chrham_2 - 12.09.2009

Quote:
Originally Posted by [KMA
America ]
your code:
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
You need:
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
you had an extra space in
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
Did not see the diffrence......
Can you underline them?


Re: 4 warnings - x-cutter - 13.09.2009

Код:
    if(strcmp(cmdtext,"/coords",true) == 0)
 {
 new strlol[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(strlol, sizeof(strlol), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, strlol);
return 1;
This is gonna fix one of the warnings.

For the others 3 search around for identation