Problem with the Streamer's OnPlayerEditDynamicObject
#1

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

Bump.
Reply
#3

Error line?
Reply
#4

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

This is odd, the public forward works fine in the other script.
Reply
#6

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)