SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/02/2012, 03:57 PM   #1
deltapro
Banned
 
Join Date: Oct 2011
Posts: 77
Reputation: 0
Question Got 2 warnings when compile

This is the warnings
Code:
(25237) : warning 219: local variable "string" shadows a variable at a preceding level
(28306) : warning 219: local variable "tmpcar" shadows a variable at a preceding level
Line 25237 -
Code:
new string[MAX_STRING];
Line 28306 -
Code:
new tmpcar = GetPlayerVehicleID(playerid);
CAn anyone help me with this warnings
Thank you
deltapro is offline   Reply With Quote
Old 16/02/2012, 04:09 PM   #2
deltapro
Banned
 
Join Date: Oct 2011
Posts: 77
Reputation: 0
Default Re: Got 2 warnings when compile

Can you give me a example.. because i am beginner lvl 2
deltapro is offline   Reply With Quote
Old 16/02/2012, 04:14 PM   #3
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,361
Reputation: 240
Default Re: Got 2 warnings when compile

you have defined these variables somewhere before !
just change the name to like string2
park4bmx is offline   Reply With Quote
Old 16/02/2012, 04:15 PM   #4
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: Got 2 warnings when compile

pawn Code:
// Global Variables
new string[ MAX_STRING ];

public OnGameModeInit( )
{
    new string[ MAX_STRING ]; // you define it again
    // Rest
    return 1;
Result: warning 219: local variable "string" shadows a variable at a preceding level
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 16/02/2012, 04:47 PM   #5
deltapro
Banned
 
Join Date: Oct 2011
Posts: 77
Reputation: 0
Default Re: Got 2 warnings when compile

Fixed.
What about the second warning?
deltapro 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]Warnings Mt Warnings Fuuu 4LiSs0N PortuguÍs/Portuguese 3 11/01/2012 10:24 AM
Can someone explain these pawn compile warnings and help me to solve them? dirkblok Help Archive 6 26/10/2009 03:38 PM
Compile Errors and Warnings Trooper[Y] Help Archive 3 10/04/2009 03:42 PM
Compile Error. Can Someone Compile For Me Please? RolePlay360 Help Archive 2 11/03/2009 09:56 PM


All times are GMT. The time now is 01:18 PM.


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