Help-ASAP - 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-ASAP (
/showthread.php?tid=372194)
Help-ASAP -
Kalroz - 25.08.2012
pawn Код:
#include <a_samp>
#include <zcmd>
new Float:position1,Float:position2,Float:position3;
new interiorid;
CMD:sposition(playerid,params[])
{
#pragma unused params
GetPlayerPos(playerid,position1,position2,position3);
GetPlayerFacingAngle(playerid,position3);
SendClientMessage(playerid,0xFF0000,"Position saved!");
interiorid = GetPlayerInterior(playerid);
return 1;
}
And i get a warning here
Код:
C:\Users\User\Desktop\spos.pwn(44) : warning 204: symbol is assigned a value that is never used: "interiorid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Please help me.
Its really urgent and i'll surely repute.
Re: Help-ASAP -
Akira297 - 25.08.2012
What is line "44" ?
Re: Help-ASAP -
Youarex - 25.08.2012
Is never used, common sense.
Re: Help-ASAP -
Gangster-rocks - 25.08.2012
pawn Код:
interiorid = GetPlayerInterior(playerid);
Change it to
pawn Код:
GetPlayerInterior(playerid,interiorid);
Re: Help-ASAP -
Lordzy - 25.08.2012
I think this line must be having warning.
pawn Код:
interiorid = GetPlayerInterior(playerid);
This might be line 44.
Re: Help-ASAP -
Youarex - 25.08.2012
The symbol
interiorid is assigned a return value of
GetPlayerInterior(playerid), but it's never used elsewhere.
Re: Help-ASAP -
Lordzy - 25.08.2012
Quote:
Originally Posted by YouareX
The symbol interiorid is assigned a return value of GetPlayerInterior(playerid), but it's never used elsewhere.
|
You mean like this?
pawn Код:
new interiorid;
CMD:test(playerid,params[])
{
#pragma unused params
interiorid = GetPlayerInterior(playerid);//Here its just assigned but not used any where.
return 1;
}
CMD:test2(playerid,params[])
{
#pragma unused params
SetPlayerInterior(playerid,interior)//Here its used for teleporting back to previous interior.
//And then the warning solved?
//Im asking because Im using mobile and cant check for errors or warnings.
Re: Help-ASAP -
TheArcher - 25.08.2012
You declarated a variable that is not used. GetPlayerInterior can stay without any variable, however it's useful if you want to simplfy your life. E.g
new interior = GetPlayerInterior(playerid);
SetPlayerInterior(playerid, interior);
instead of doing
SetPlayerInterior(playerid, GetPlayerInterior(playerid));
these examples are the same but more simple to remember things
Re: Help-ASAP -
Youarex - 25.08.2012
Quote:
Originally Posted by [xB]Lordz
You mean like this?
pawn Код:
new interiorid; CMD:test(playerid,params[]) { #pragma unused params interiorid = GetPlayerInterior(playerid);//Here its just assigned but not used any where. return 1; } CMD:test2(playerid,params[]) { #pragma unused params SetPlayerInterior(playerid,interior)//Here its used for teleporting back to previous interior. //And then the warning solved? //Im asking because Im using mobile and cant check for errors or warnings.
|
Yes, that's a good example.
Re: Help-ASAP -
[Y]P90 - 25.08.2012
You have written 2 newґs for interiorid. Delete the one in line 44.