warning 203: symbol is never used: - 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)
+--- Thread: warning 203: symbol is never used: (
/showthread.php?tid=454465)
warning 203: symbol is never used: -
Magic_Time - 29.07.2013
Hi,
I'm making a rape command for my Cops And Robbers server.
I have the following problem.
Whenever I try to compile my gamemode I get this warning.
warning 203: symbol is never used: RapesNames, but I'm actually using it..
Code:
pawn Код:
new RapesNames[][] =
{
"Chlamydia",
"Syphilis",
"Gonorrhea",
"HPV",
"STD",
"Hepatitis B"
};
Below the command..
pawn Код:
//Some stuff here..
new rand;
rand = random(sizeof(RapesNames));
SendFMessage(INVALID_PLAYER_ID, COLOR_MAROON, "%s has been infected of %s by %s.", Name(targetid), rand, Name(playerid));
Can you help me to get rid of that annoying warning, please.
Thanks.
Re: warning 203: symbol is never used: -
MP2 - 29.07.2013
sizeof doesn't count as 'using it'. 'rand' is just storing a random value, and you're displaying that value. Change 'rand' at the end of format to RapesNames[rand]. You should really use STDnames or something though - they're STDs, not 'rapes'.
Also, the grammar/English in that formatted messages is bad, try this:
%s has been infected with %s by %s
or
%s has infected %s with %s (better imo)
Re: warning 203: symbol is never used: -
FaceTutorialz - 29.07.2013
EDIT: He beat me too it...
Re: warning 203: symbol is never used: -
Magic_Time - 29.07.2013
Quote:
Originally Posted by MP2
sizeof doesn't count as 'using it'. 'rand' is just storing a random value, and you're displaying that value. Change 'rand' at the end of format to RapesNames[rand]. You should really use STDnames or something though - they're STDs, not 'rapes'.
Also, the grammar/English in that formatted messages is bad, try this:
%s has been infected with %s by %s
or
%s has infected %s with %s (better imo)
|
Okay, it's fixed. Sorry for my bad english.
Re: warning 203: symbol is never used: -
MP2 - 29.07.2013
Don't worry about it. Was just a friendly suggestion
.