SA:MP Pawno Warnings [Need Assistance]
#1

Код:
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(23536) : warning 217: loose indentation
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(23537) : warning 217: loose indentation
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(30944) : warning 219: local variable "idcar" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
I need help removing all the warnings on my gamemode.
Reply
#2

hello for loose indentation
just add top of your script
Quote:

#pragma tabsize 0

and for idcar warning change idcar to idcar1
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=274028 for solving most warnings.

For " shadows at a preceding level":

pawn Код:
new MyVar;
if(playerid == playerid)
{
      new MyVar; //<-- Two variables with similar names causes this problem
      //^ Rename or remove to fix.
}
Reply
#4

Quote:
Originally Posted by Sufyan
Посмотреть сообщение
hello for loose indentation
just add top of your script

and for idcar warning change idcar to idcar1
First, I tried the loose indentation and somehow I still have the same warning.
The other warning I did not understand the instructions you told me.
Reply
#5

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=274028 for solving most warnings.

For " shadows at a preceding level":

pawn Код:
new MyVar;
if(playerid == playerid)
{
      new MyVar; //<-- Two variables with similar names causes this problem
      //^ Rename or remove to fix.
}
I don't know where to place it.
INFO: I'm a new scripter so I don't know what to do really
Reply
#6

This is when you get indentation warnings:

pawn Код:
public MyCallback()
{
  SendClientMessage(playerid, -1, "...");
           printf("...");
Function();
      return 1;
}
If the lines doesn't start with the proper tab.

To fix it:

Option 1:
pawn Код:
//Add this to the top of the script:
#pragma tabsize 0
Option 2:
pawn Код:
//Get everything in correct tabs:
public MyCallback()
{
      SendClientMessage(playerid, -1, "...");
      printf("...");
      Function();
      return 1;
}
So, fix the tabs of your warning lines.

---

And to fix: "local variable "Some Name" shadows a variable at a preceding level

You have to rename "idcar" of the other part to "idcar2" in your case.

You better show us the part of code.
Reply
#7

PAWN Code
Код:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <a_npc>
#include <streamer>
#include <Dini>
#include <dutils>

static gTeam[MAX_PLAYERS];

#pragma unused ret_memcpy
#pragma tabsize 0

#define Version "4.3"
Indentation
Код:
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(23537) : warning 217: loose indentation
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(23538) : warning 217: loose indentation
C:\Users\Tran\Desktop\Mike's Roleplay 0.3d\gamemodes\larp.pwn(30945) : warning 219: local variable "idcar" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Reply
#8

I cannot seem to find the pawn code of "idcar"
Reply
#9

CTRL + F, then see that. Otherwise, use CTRL + G and search for the numbers in the warning lines.
Reply
#10

Quote:
Originally Posted by iGetty
Посмотреть сообщение
CTRL + F, then see that. Otherwise, use CTRL + G and search for the numbers in the warning lines.
Nope, I still can't find it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)