SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/01/2018, 11:40 AM   #1
Saddin
Huge Clucker
 
Saddin's Avatar
 
Join Date: Mar 2011
Posts: 372
Reputation: 35
Default Sublime Text Editor 3 - warning problems

I start working on new script and now my Sublime Text shows a lot of warnings:

PHP Code:
warning 219local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level 
Does anyone know the fix? I know what warning means but I don't have time and nerves to go and fix over 1000 variable names... in more than 1 file.
Saddin is offline   Reply With Quote
Old 30/01/2018, 12:05 PM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Sublime Text Editor 3 - warning problems

that looks like you did something like this:
PHP Code:
new i;
public 
OnPlayerConnect(playerid)
{
    for(new 
ii<MAX_PLAYERSi++;)
    { 
//..etc

that's why you should leave such single letters for loops only.
EDIT:
All you need to do is find the new i; on top of your script somewhere and simply remove it.
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 30/01/2018, 01:06 PM   #3
VeryTallMidget
Big Clucker
 
VeryTallMidget's Avatar
 
Join Date: Apr 2017
Location: North LV, Emerald Isle
Posts: 115
Reputation: 19
Default Re: Sublime Text Editor 3 - warning problems

But if "i" is declared again, isn't its value erased ? - meaning it has NULL, empty value.
Mostly variables are re-usable with no problems...
Global and Local variables dont have conflict, variables inside procedures and functions are local.
Maybe sa:mp script works differently...
VeryTallMidget is offline   Reply With Quote
Old 30/01/2018, 01:28 PM   #4
Saddin
Huge Clucker
 
Saddin's Avatar
 
Join Date: Mar 2011
Posts: 372
Reputation: 35
Default Re: Sublime Text Editor 3 - warning problems

In Pawno everything is fine but in Sublime I got warning from script and includes also...
Saddin is offline   Reply With Quote
Old 30/01/2018, 02:01 PM   #5
VeryTallMidget
Big Clucker
 
VeryTallMidget's Avatar
 
Join Date: Apr 2017
Location: North LV, Emerald Isle
Posts: 115
Reputation: 19
Default Re: Sublime Text Editor 3 - warning problems

Maybe Sublime is over-reacting

Does Sublime have built-in error checking for Pawno or c++ ?
VeryTallMidget is offline   Reply With Quote
Old 30/01/2018, 02:25 PM   #6
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 850
Reputation: 213
Default Re: Sublime Text Editor 3 - warning problems

Quote:
Originally Posted by VeryTallMidget View Post
Maybe Sublime is over-reacting
Do you even know what the fuck are you talking about? A BIG-ASS NO.
__________________


A new Heavy Roleplay server.

Forums | Discord

cuber is offline   Reply With Quote
Old 30/01/2018, 10:10 PM   #7
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Sublime Text Editor 3 - warning problems

I'm using it and i never faced any problems, perhaps you should try using zeexs compiler as the build system?
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 31/01/2018, 09:40 AM   #8
Saddin
Huge Clucker
 
Saddin's Avatar
 
Join Date: Mar 2011
Posts: 372
Reputation: 35
Default Re: Sublime Text Editor 3 - warning problems

Someone?
Saddin is offline   Reply With Quote
Old 31/01/2018, 09:47 AM   #9
Kane
Gangsta
 
Kane's Avatar
 
Join Date: Sep 2012
Posts: 822
Reputation: 130
Default Re: Sublime Text Editor 3 - warning problems

Go back to where you last used ` i ` as a variable and look for any problems.

are you using modules?
__________________
Los Santos Roleplay - Developer
@ls-rp.com

Former Beta Tester

Kane is offline   Reply With Quote
Old 01/02/2018, 03:04 PM   #10
Saddin
Huge Clucker
 
Saddin's Avatar
 
Join Date: Mar 2011
Posts: 372
Reputation: 35
Default Re: Sublime Text Editor 3 - warning problems

Quote:
Originally Posted by Arthur Kane View Post
Go back to where you last used ` i ` as a variable and look for any problems.

are you using modules?
No, I'm not using modules.
Saddin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] warning na gamemode * sublime text * DKDarkking Português/Portuguese 2 28/08/2015 09:55 PM
AutoComplete/Sublime text editor? PawnoQ Everything and Nothing 4 10/11/2014 12:38 PM
C:\Users\zero\AppData\Roaming\Sublime Text 2\Packages\User\main.pwn(343) : warning 219: local variable "targetid" shadow Le3aT Scripting Help 4 26/06/2014 06:26 AM
Sublime Text 2 pawn editor MatriXgaMer Scripting Help 2 15/01/2014 02:45 PM


All times are GMT. The time now is 10:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.