undefined symbol - 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: undefined symbol (
/showthread.php?tid=659139)
undefined symbol -
Zeus666 - 24.09.2018
PHP код:
if(GetRNPCHealth(damagedid) < 0.0 && !rnpcData[damagedid][RNPC_DEAD])
{
CreateLootsZombie(item[],fPos[0],fPos[1],fPos[2]);
}
Код:
error 017: undefined symbol "item"
PHP код:
function CreateLootsZombie(item[],Float:pXX,Float:pYX,Float:pZX)
{
new strt[128];
lootCount += 1;
Loot[lootCount][xLootdropZ] = pXX;
Loot[lootCount][yLootdropZ] = pYX;
Loot[lootCount][zLootdropZ] = pZX;
Loot[lootCount][AntiDup] = 1;
format(Loot[lootCount][lootDrop], 128, "%s", item);
Loot[lootCount][LootID] = CreateDynamicObject(2907/*DayZSA_SelectObj()*/,pXX+0.3,pYX+float(1),pZX-0.7,0.0,0.0,0.0,-1,-1,-1,1000.0);
format(strt,sizeof(strt),""COL_GREEN"ACTION\n"COL_WHITE"PRESS N");
Loot[lootCount][TextID] = CreateDynamic3DTextLabel(strt,-1,pXX+0.3,pYX+float(1),pZX-0.7,8.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1,-1,-1,-1, 8.0);
return 1;
}
Do you know why this is not working?
Re: undefined symbol -
VVWVV - 24.09.2018
Get rid of the square brackets when calling functions.
Right code:
pawn Код:
CreateLootsZombie(item,fPos[0],fPos[1],fPos[2]);
Re: undefined symbol -
Zeus666 - 24.09.2018
Quote:
Originally Posted by VVWVV
Get rid of the square brackets when calling functions.
Right code:
pawn Код:
CreateLootsZombie(item,fPos[0],fPos[1],fPos[2]);
|
I have already try this, still undefined symbol. item
Re: undefined symbol -
VVWVV - 24.09.2018
Quote:
Originally Posted by Zeus666
I have already try this, still undefined symbol. item
|
I think you just need to pass a string.
pawn Код:
CreateLootsZombie("String",fPos[0],fPos[1],fPos[2]);
Re: undefined symbol -
Undef1ned - 24.09.2018
It's wrong, those are the parameters where you defined the "CreateLootsZombie" callback.
Show the complete code where it is
"if(GetRNPCHealth(damagedid) < 0.0 && !rnpcData[damagedid][RNPC_DEAD])
{
CreateLootsZombie(item[],fPos[0],fPos[1],fPos[2]);
}"
Re: undefined symbol -
ISmokezU - 24.09.2018
A reminder that you need to put the CreateLootsZombie(...) above so it could be used among the script.
Also you didn’t specify an index for item[] when you used it.
Re: undefined symbol -
Electrifying - 24.09.2018
Why did you put that?
Код:
CreateLootsZombie(item[],fPos[0],fPos[1],fPos[2]);
you need to define item[]
Re: undefined symbol -
AdamCooper - 24.09.2018
well pwn is asking u what its "item"
you need to make a new item = getpvar or what it defines.
for example
Код:
new id = GetPVarInt(playerid, "BizzEnter");
if(!GetCloseBizzSafe(playerid, id)) return error(playerid, "You aren't near a biz-safe!");