SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 10/11/2019, 03:33 PM   #1
Skaidrius
Little Clucker
 
Join Date: Jan 2018
Posts: 8
Reputation: 0
Default warning 203: symbol is never used: "id"

public OnGameModeInit()
{

static
arrVirtualWorlds[2000],
id = -1;
WeatherRotator();

SQL_Connect();
ManualVehicleEngineAndLights();
new rcon[80];
format(rcon, sizeof(rcon), "hostname %s", SERVER_NAME);
SendRconCommand(rcon);
format(rcon, sizeof(rcon), "weburl %s", SERVER_URL);
SendRconCommand(rcon);
SetGameModeText(SERVER_REVISION);
Skaidrius is offline   Reply With Quote
Old 10/11/2019, 03:55 PM   #2
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 607
Reputation: 54
Default Re: warning 203: symbol is never used: "id"

so, what's the problem?
__________________
coool is offline   Reply With Quote
Old 10/11/2019, 04:14 PM   #3
WalkZ
Big Clucker
 
WalkZ's Avatar
 
Join Date: Oct 2019
Location: Pakistan
Posts: 100
Reputation: 4
Default Re: warning 203: symbol is never used: "id"

Warning is clear, You defined a symbol but never used it and it is id

It will remove that warning

PHP Code:
public OnGameModeInit()
{

static
arrVirtualWorlds[2000], 
WeatherRotator();

SQL_Connect();
ManualVehicleEngineAndLights();
new 
rcon[80];
format(rconsizeof(rcon), "hostname %s"SERVER_NAME);
SendRconCommand(rcon);
format(rconsizeof(rcon), "weburl %s"SERVER_URL);
SendRconCommand(rcon);
SetGameModeText(SERVER_REVISION); 
Also wrap your code with [*CODE][*/CODE] so it will be more understandable.
__________________
[EN] Chinatown Freeroam [BETA]
- Different Advanced Deathmatches with Times and Scores
- Different Races
- Different Events
- Gangs (Groves, Ballas, Aztecas, Mafia, Bikers & Triads)
- Drugs with Drug Dealers at Streets
- Hitman Bounty System
- Ammunations, Pizza Stacks, Burger-Shots, Banks
- Jobs (Pizza-Boy, Plumber, Trasher, Bus)
- Money-Bag every 30 minutes
- Reaction Test every 15 minutes
- Daily improving by adding new features and fixing present bugs.
WalkZ is offline   Reply With Quote
Old 10/11/2019, 04:16 PM   #4
DylanAr
Little Clucker
 
DylanAr's Avatar
 
Join Date: Feb 2012
Location: Belgium
Posts: 5
Reputation: 0
Default Re: warning 203: symbol is never used: "id"

It's saying that id is never used, so remove it from the code.

Code:
public OnGameModeInit()
{
	static arrVirtualWorlds[2000];
	WeatherRotator();

	SQL_Connect();
	ManualVehicleEngineAndLights();
	new rcon[80];
	format(rcon, sizeof(rcon), "hostname %s", SERVER_NAME);
	SendRconCommand(rcon);
	format(rcon, sizeof(rcon), "weburl %s", SERVER_URL);
	SendRconCommand(rcon);
	SetGameModeText(SERVER_REVISION);

        ...
DylanAr is offline   Reply With Quote
Old 10/11/2019, 06:51 PM   #5
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,515
Reputation: 1635
Default Re: warning 203: symbol is never used: "id"

Assuming SERVER_NAME and SERVER_URL are macro's (#define) you don't need to use format():

Code:
SendRconCommand("hostname "SERVER_NAME);
SendRconCommand("weburl "SERVER_URL);
__________________
Do not click on this URL -It is secret information
RIP Slayer 1981-2019 \m/
Kwarde is offline   Reply With Quote
Old 11/11/2019, 09:31 AM   #6
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 607
Reputation: 54
Default Re: warning 203: symbol is never used: "id"

There is also an alternative
Code:
#pragma unused id //pragma was discouraged in the now-deleted rules thread
__________________
coool is offline   Reply With Quote
Old 11/11/2019, 09:03 PM   #7
coo
Little Clucker
 
Join Date: Sep 2019
Posts: 3
Reputation: 0
Default Re: warning 203: symbol is never used: "id"

You have defined "id" but you never did anything with it in it's code. You don't need to have that line therefore.
coo 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
warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength") SapMan Scripting Help 10 14/10/2018 11:04 PM
Command warning (params) warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength") Riwerry Scripting Help 1 24/05/2014 11:54 PM
warning 224: indeterminate array size in "sizeof" expression (symbol "") Fierro Scripting Help 7 12/10/2013 03:59 PM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 01:08 PM
[SOLVED]warning 224: indeterminate array size in "sizeof" expression (symbol "") LarzI Help Archive 2 22/12/2009 05:32 AM


All times are GMT. The time now is 06:46 PM.


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