Need help with Warnings. - 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: Need help with Warnings. (
/showthread.php?tid=584387)
Need help with Warnings. -
canip0000 - 04.08.2015
Here is the warnings
Код:
C:\Users\Canip\Desktop\GRP\gamemodes\lsrpedit.pwn(25060) : warning 204: symbol is assigned a value that is never used: "faction"
C:\Users\Canip\Desktop\GRP\gamemodes\lsrpedit.pwn(25208) : warning 204: symbol is assigned a value that is never used: "faction"
C:\Users\Canip\Desktop\GRP\gamemodes\lsrpedit.pwn(25361) : warning 204: symbol is assigned a value that is never used: "faction"
Here is one of the script lines.
Код:
else if(PlayerInCar(playerid))
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsACopCar(vehicle))
{
if(!CheckWeapon(playerid, weaponid)) return SCM(playerid, COLOR_LIGHTRED, "You don't have this weapon.");
if(weaponid == 3 || weaponid == 24 || weaponid == 41) return SCM(playerid, COLOR_LIGHTRED, "You may not place this weapon.");
new faction = PlayerInfo[playerid][pFaction];
if(PlayerInfo[playerid][pFaction] != LSPD && SASD) return SCM(playerid, COLOR_LIGHTRED, "Invalid faction");
if(!CopDuty{playerid}) return SCM(playerid, COLOR_LIGHTRED, "You must be on duty.");
format(msg, sizeof(msg), "stores a %s in the Cruiser's trunk.", GetWeaponNameEx(weaponid));
ActionMessage(playerid, 15.0, msg);
RemovePlayerWeapon(playerid, weaponid);
}
Re: Need help with Warnings. -
CristianHG - 04.08.2015
It just means that you defined faction (On or near line 8 I believe) and never used it anywhere in the script, and that's actually what it shows on your code block.
Re: Need help with Warnings. -
JaydenJason - 04.08.2015
^^^
Remove
Код:
new faction = PlayerInfo[playerid][pFaction];
And you're good to go!
You're making a new faction= blabla
and then you're never using it again.
Re: Need help with Warnings. -
Roberto80 - 04.08.2015
Add:
Код:
#pragma unused faction