SA-MP Forums Archive
Help Again - 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: Help Again (/showthread.php?tid=357059)



Help Again - kaloqn54 - 05.07.2012

Код:
public OnFilterScriptExit()
{
	return 1;
}

new pickup;

public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	pickup = CreatePickup(1318, 20, 2309.8423, -1644.9840, 14.8270, -1);
	pickup = CreatePickup(1318, 20, 501.8214, -69.0665, 998.7578, -1);
	pickup = CreatePickup(1239, 3, 497.1258, -75.9710, 998.7578, -1);
	Create3DTextLabel("Напиши /enter", 0x2D06A1, 2309.8423, -1644.9840, 14.8270, 40.0, 0 ,0);
	Create3DTextLabel("Напиши /exit", 0x2D06A1, 501.8214, -69.0665, 998.7578, 40.0, 0 ,0);
	Create3DTextLabel("Напиши /drinks", 0x2D06A1, 497.1258, -75.9710, 998.7578, 40.0, 0 ,0);
	return 1;
}
D:\igri\GTA San Andreas\filterscripts\xc.pwn(29) : warning 204: symbol is assigned a value that is never used: "pickup"

i tried to fix it but again t's showing this


Re: Help Again - .FuneraL. - 05.07.2012

Add the "new pickup;" in OnGameModeInit and try compile.


Re: Help Again - kaloqn54 - 05.07.2012

There are error and warning man


Re: Help Again - kaloqn54 - 05.07.2012

There are erors and warning man


Re: Help Again - FUNExtreme - 06.07.2012

You don't have to assign the pickups to a variable if you do not need them in your script. Just remove all the pickup variables and it'll be fixed


Re: Help Again - kaloqn54 - 06.07.2012

if fixed it with the command AddStaticPickup


Re: Help Again - Grim_ - 06.07.2012

As FUNExtreme explained, you are not actually using the variable, you are just creating it and assigning a variable to it. At the moment, it is useless, as you never reference it at a later point. Unless you plan to use the variables at a later point, such as at OnPlayerPickUpPickup, then you can delete the variable and where you assign it to the CreatePickup lines. Do not simply change the function to remove the warnings, you are just wasting memory. It is not a big deal with this snippet, but if you are using those techniques in a bigger script, it could cause problems.