Problem with the Streamer's OnPlayerEditDynamicObject - 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: Problem with the Streamer's OnPlayerEditDynamicObject (
/showthread.php?tid=562133)
Problem with the Streamer's OnPlayerEditDynamicObject -
JaKe Elite - 07.02.2015
Hello guys,
I have been scripting a dynamic vendor system however, I have been having issues OnPlayerEditDynamicObject.
It gives an error of:
Code:
C:\Users\Justin\Documents\San Andreas Multiplayer Pawn Scripting\gamemodes\trp.pwn(3829) : error 010: invalid function or declaration
C:\Users\Justin\Documents\San Andreas Multiplayer Pawn Scripting\gamemodes\trp.pwn(3849) : error 006: must be assigned to an array
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
pawn Code:
//public OnPlayerEditDynamicObject is 3829
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
new string[128];
if(IsValidDynamicObject(objectid))
{
new id = GetPVarInt(playerid, "v_ID");
if(response == EDIT_RESPONSE_CANCEL)
{
if(IsValidDynamic3DTextLabel(DvInfo[id][dvTextID])) DestroyDynamic3DTextLabel(DvInfo[id][dvTextID]);
if(IsValidDynamicObject(DvInfo[id][dvObject])) DestroyDynamicObject(DvInfo[id][dvObject]);
LoadDynamicVendors();
SendClientMessage(playerid, -1, "Editing has been cancelled.");
}
else if(response == EDIT_RESPONSE_FINAL)
{
DvInfo[id][dv_OPos][0] = x;
DvInfo[id][dv_OPos][1] = y; // This is 3849
DvInfo[id][dv_OPos][2] = z;
DvInfo[id][dv_OPos][3] = rx;
DvInfo[id][dv_OPos][4] = ry;
DvInfo[id][dv_OPos][5] = rz;
DvInfo[id][dvVW] = GetPlayerVirtualWorld(playerid); DvInfo[id][dvInt] = GetPlayerInterior(playerid);
if(IsValidDynamic3DTextLabel(DvInfo[id][dvTextID])) DestroyDynamic3DTextLabel(DvInfo[id][dvTextID]);
if(IsValidDynamicObject(DvInfo[id][dvObject])) DestroyDynamicObject(DvInfo[id][dvObject]);
SaveDynamicVendors();
LoadDynamicVendors();
format(string, sizeof(string), "You have edited the position of the vendorID %d's stand.", id);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}
I have never done anything wrong but why do i receive these errors? Someone?
Re: Problem with the Streamer's OnPlayerEditDynamicObject -
JaKe Elite - 07.02.2015
Bump.
Re: Problem with the Streamer's OnPlayerEditDynamicObject -
Beckett - 07.02.2015
Error line?
Re: Problem with the Streamer's OnPlayerEditDynamicObject -
JaKe Elite - 07.02.2015
I have already commented it.
But alright, here
pawn Code:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) // 1st Error
DvInfo[id][dv_OPos][1] = y; //2nd Error
Re: Problem with the Streamer's OnPlayerEditDynamicObject -
JaKe Elite - 07.02.2015
This is odd, the public forward works fine in the other script.
Re: Problem with the Streamer's OnPlayerEditDynamicObject -
Threshold - 07.02.2015
Another weird thing, is it only seems to be affecting the variable 'y'. Are you sure you don't have any other variables named 'y' that may be shadowing a variable at a preceding level?