03.08.2016, 08:59
So I have two questions regarding two different commands, pretty much. I'm currently working on an All Points Bulletin command. So there's a /newapb command, where you will have to write /newapb create in order to create. It's the create code I need help with, because it apparently does not want to work with me. I'm new to this and don't see the logic in it right now, like how to bring some info of the code to the next part (dialog wise).
The "create" of /makeapb (yes, there's multiple different strings, here's the create one):
So I made that dialog (using easyDialogs by the way). The dialog looks like this:
So that "number" is supposed to be the one you write when you do /makeapb create NUMBERHERE
.. and should be brought to this dialog eh?
Right now, nothiing happens when I write it. If I follow the syntax of course, otherwise it's an "unknown command".
My other question is regarding my /namechange command. So in the script that I am using you can have multiple vehicles, but only one spawned at a time. So when I do namechange I'd like it to update the owner of the vehicles that is in his name. E.g a player's named John Doe. He wants namechange to Doe John, and I want to update his vehicles so it is in his new name - that way he'll keep the vehicle.
Right now this is the part of namechange that should change the owner of the vehicle, but doesn't:
Ontop of the namechange command:
Error I get when using namechange command:
The "create" of /makeapb (yes, there's multiple different strings, here's the create one):
Code:
else if(CompareStrings(action, "create")) // HAS TO BE FIXED { if(sscanf(params,"{s[64]}d",number)) return SyntaxMSG(playerid, "/apb create [number]"); if(ApbInfo[number][apbOn]) return SCM(playerid, COLOR_GREY, "This APB already exists."); Dialog_Show(playerid, APBCreate, DIALOG_STYLE_INPUT, "APB Creation", "", "Submit", "Cancel"); }
So that "number" is supposed to be the one you write when you do /makeapb create NUMBERHERE
.. and should be brought to this dialog eh?
Code:
Dialog:APBCreate(playerid, response, listitem, inputtext[]) { if(response) { new number, charge[256]; if(strlen(inputtext) < 7 || strlen(inputtext) > 100) return Dialog_Show(playerid, APBCreate, DIALOG_STYLE_INPUT, "APB Creation", "The APB must contain between 3-100 characters", "Submit", "Cancel"); SCMEx(playerid, COLOR_LIGHTRED, "You have created APB number: %d.", number); format(ApbInfo[number][apbCharge], 256, "%s", inputtext); ApbInfo[number][apbOfficer] = GetNameEx(playerid); ApbInfo[number][apbPage] = number; ApbInfo[number][apbID] = number; ApbInfo[number][apbOn] = 1; OnApbCreate(number, ApbInfo[number][apbCharge], GetNameEx(playerid)); } return 1; }
My other question is regarding my /namechange command. So in the script that I am using you can have multiple vehicles, but only one spawned at a time. So when I do namechange I'd like it to update the owner of the vehicles that is in his name. E.g a player's named John Doe. He wants namechange to Doe John, and I want to update his vehicles so it is in his new name - that way he'll keep the vehicle.
Right now this is the part of namechange that should change the owner of the vehicle, but doesn't:
Code:
for(new i = 0; i < MAX_VEHICLES; i++) { if(CompareStrings(VehicleInfo[i][carOwner], GetName(id))) { format(VehicleInfo[i][carOwner], MAX_PLAYER_NAME, "%s", name); } }
Code:
new id,name[MAX_PLAYER_NAME];
Code:
[DEBUG] mysql_tquery - connection: 1, query: "UPDATE `ownedvehicles` SET `plate` = 'DM' WHERE `owner` = 'John", callback: "(null)", format: "(null)" [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'Doe_John' in 'field list'