//under cmd
orm_insert(DynamicDoor[dd][ORM_ddID], "OnDoorCreated", "d", dd);
//callback
public OnDoorCreated(dd)
{
DynamicDoor[dd][ddID] = cache_insert_id();
printf("DoorCreated: %d", DynamicDoor[dd][ddID]);
return 1;
}
[22:27:56] [DEBUG] orm_insert - orm_id: 0, callback: "OnDoorCreated", format: "d" [22:27:56] [ERROR] "orm_insert" - invalid orm id (id: 0) [22:27:56] [DEBUG] orm_update - orm_id: 0 [22:27:56] [ERROR] "orm_update" - invalid orm id (id: 0) |
[23:21:26] [DEBUG] orm_create - table: "dynamicdoors", connectionHandle: 1 [23:21:26] [DEBUG] COrm::Create - creating new orm object.. [23:21:26] [DEBUG] COrm::Create - orm object created (id: 9) [23:21:26] [DEBUG] orm_addvar_int - orm_id: 9, var: 04258C84, varname: "ID" [23:21:26] [DEBUG] orm_setkey - orm_id: 9, varname: "ID" [23:21:26] [DEBUG] orm_insert - orm_id: 9, callback: "OnDoorCreated", format: "d" [23:21:26] [DEBUG] CMySQLQuery::Execute[OnDoorCreated] - starting query execution [23:21:26] [ERROR] CMySQLQuery::Execute[OnDoorCreated] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`' at line 1 [23:21:26] [DEBUG] CMySQLQuery::Execute[OnDoorCreated] - error will be triggered in OnQueryError [23:21:26] [DEBUG] Calling callback "OnQueryError".. |
new ORM:ormid = DynamicDoor[dd][ORM_ddID] = orm_create("dynamicdoors");
orm_addvar_int(ormid, DynamicDoor[dd][ddID], "ID");
orm_setkey(ormid, "ID");
orm_insert(DynamicDoor[dd][ORM_ddID], "OnDoorCreated", "d", dd);
YCMD:createdd(playerid, params[], help)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "You are unathourized to do this command");
new ownerid;
if(sscanf(params, "i", ownerid)) return SCM(playerid, COLOR_GREY, "/createdd [playerid]");
if(!IsPlayerLoggedIn(ownerid)) return SCM(playerid, COLOR_GREY, "This player is not logged");
for(new dd = 0; dd < MAX_DDOORS; dd++)
{
if(!DynamicDoor[dd][ddCreated])
{
new Float:gPos[4], string[200];
GetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
GetPlayerFacingAngle(playerid, gPos[3]);
DynamicDoor[dd][ddCreated] = 1;
format(DynamicDoor[dd][ddOwner], 32, "%s", RPNU(ownerid));
format(DynamicDoor[dd][ddName], 50, "%s Door", RPNU(ownerid));
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass), "123");
format(DynamicDoor[dd][ddPassword], 12, "%s", hashpass);
DynamicDoor[dd][ddPasswordSwitch] = 0;
DynamicDoor[dd][ddEnt][0] = gPos[0];
DynamicDoor[dd][ddEnt][1] = gPos[1];
DynamicDoor[dd][ddEnt][2] = gPos[2];
DynamicDoor[dd][ddEnt][3] = gPos[3];
DynamicDoor[dd][ddEntVW] = GetPlayerVirtualWorld(playerid);
DynamicDoor[dd][ddEntInt] = GetPlayerInterior(playerid);
new ORM:ormid = DynamicDoor[dd][ORM_ddID] = orm_create("dynamicdoors");
orm_addvar_int(ormid, DynamicDoor[dd][ddID], "ID");
orm_setkey(ormid, "ID");
orm_insert(ormid, "OnDoorCreated", "d", dd);
DynamicDoor[dd][ddEntPickup] = CreateDynamicPickup(1318, 1, DynamicDoor[dd][ddEnt][0], DynamicDoor[dd][ddEnt][1], DynamicDoor[dd][ddEnt][2], DynamicDoor[dd][ddEntVW], DynamicDoor[dd][ddEntInt], -1, 100.0);
DynamicDoor[dd][ddExPickup] = CreateDynamicPickup(1318, 1, DynamicDoor[dd][ddEx][0], DynamicDoor[dd][ddEx][1], DynamicDoor[dd][ddEx][2], DynamicDoor[dd][ddExVW], DynamicDoor[dd][ddExInt], -1, 100.0);
format(string, sizeof(string), "%d for %s was created", dd, RPNU(ownerid));
SCM(playerid, COLOR_GREEN, string);
dd = MAX_DDOORS;
}
}
return 1;
}
public OnDoorCreated(dd)
{
//DynamicDoor[dd][ddID] = cache_insert_id();
//printf("DoorCreated: %d", DynamicDoor[dd][ddID]);
printf("Player %d signed up and their ID value is %d.", dd, DynamicDoor[dd][ddID]);
return 1;
}
[08:01:46] [DEBUG] COrm::Create - creating new orm object.. [08:01:46] [DEBUG] COrm::Create - orm object created (id: 9) [08:01:46] [DEBUG] orm_addvar_int - orm_id: 9, var: 0450428C, varname: "ID" [08:01:46] [DEBUG] orm_setkey - orm_id: 9, varname: "ID" [08:01:46] [DEBUG] orm_insert - orm_id: 9, callback: "OnDoorCreated", format: "d" [08:01:46] [DEBUG] CMySQLQuery::Execute[OnDoorCreated] - starting query execution [08:01:46] [ERROR] CMySQLQuery::Execute[OnDoorCreated] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`' at line 1 [08:01:46] [DEBUG] CMySQLQuery::Execute[OnDoorCreated] - error will be triggered in OnQueryError [08:01:46] [DEBUG] Calling callback "OnQueryError".. |
[07:59:32] [ERROR] CMySQLQuery::Execute[OnDoorCreated] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`' at line 1
print off all the parameters of OnQueryError |