SA-MP Forums Archive
How to fix it? - 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: How to fix it? (/showthread.php?tid=343587)



How to fix it? - RipLagger - 18.05.2012

Quote:

YCMD:newhouse(playerid, params[], help)
{
#pragma unused help
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You must be RCON admin");
new
Float:Pos[3],string[64],id,name[48],price,level;
if(sscanf(params, "is[48]ii",id,name,price,level)) return SCM(playerid, COLOR_RED, "Usage:"COL_WHITE" /newhouse [ID] [Name] [Price] [Level]");
if(id >= MAX_HOUSE) return SCM(playerid, COLOR_RED, "EROR: "COL_WHITE"Try again. You are type wrong house id");
format(string, sizeof(string), House_File, id);
if(fexist(string)) return SCM(playerid, COLOR_RED, "House on that id already exist!");
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
CreateSaveHouse(name,id,price,level,id+1,Pos[0],Pos[1],Pos[2]);
SCM(playerid, -1, ""COL_YELLOW"You are make house.");
return 1;
}

warning
Quote:

D:\GTASAN~1\GAMEMO~1\HSDM.pwn(13776) : warning 219: local variable "Pos" shadows a variable at a preceding level




Re: How to fix it? - Flake. - 18.05.2012

this means you have made pos a global varible and oyu are calling it again just make this


this
pawn Код:
Float:Pos[3],string[64],id,name[48],price,level;
to this:
pawn Код:
new string[64],id,name[48],price,level;



Re: How to fix it? - RipLagger - 18.05.2012

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
this means you have made pos a global varible and oyu are calling it again just make this


this
pawn Код:
Float:Pos[3],string[64],id,name[48],price,level;
to this:
pawn Код:
new string[64],id,name[48],price,level;
now error on GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]).
warning code D:\GTASAN~1\GAMEMO~1\HSDM.pwn(13780) : error 035: argument type mismatch (argument 2)

come on help me, please


Re: How to fix it? - Flake. - 18.05.2012

go to the otp of the script and add

pawn Код:
new Float:Pos[3];
and make sure its the only one in the gamemode