Help-ASAP
#1

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.
Reply
#2

What is line "44" ?
Reply
#3

pawn Код:
new interiorid;
Is never used, common sense.
Reply
#4

pawn Код:
interiorid = GetPlayerInterior(playerid);
Change it to
pawn Код:
GetPlayerInterior(playerid,interiorid);
Reply
#5

I think this line must be having warning.
pawn Код:
interiorid = GetPlayerInterior(playerid);
This might be line 44.
Reply
#6

The symbol interiorid is assigned a return value of GetPlayerInterior(playerid), but it's never used elsewhere.
Reply
#7

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.
Reply
#8

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
Reply
#9

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.
Reply
#10

You have written 2 newґs for interiorid. Delete the one in line 44.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)