SHOW:
|
|
- or go back to the newest paste.
| 1 | /* | |
| 2 | ||
| 3 | V.1.2 | MAP CREATOR | |
| 4 | ---------------------| | |
| 5 | Skype: alex20.11 | |
| 6 | ||
| 7 | */ | |
| 8 | #define FILTERSCRIPT | |
| 9 | ||
| 10 | ||
| 11 | #include <a_samp> | |
| 12 | #include <zcmd> | |
| 13 | #include <streamer> | |
| 14 | #include <sscanf2> | |
| 15 | #include <a_mysql> | |
| 16 | #include <mSelection> | |
| 17 | - | #include <YSI\y_ini> |
| 17 | + | |
| 18 | // CONFIGURATION ACCES BDD | |
| 19 | #define HOST "127.0.01" | |
| 20 | #define USER "root" | |
| 21 | #define MDP "" | |
| 22 | #define DB "YOUR DATABASE" | |
| 23 | ||
| 24 | // COULEURS | |
| 25 | #define BLEUCLAIR 0xFF51B3FFAA | |
| 26 | #define BLEUCLAIR1 "{051B3F}"
| |
| 27 | #define BLANC1 "{FFFFFF}"
| |
| 28 | ||
| 29 | //DIALOG | |
| 30 | #define EDITO 100 | |
| 31 | #define EDITO0 200 | |
| 32 | #define EDITO1 300 | |
| 33 | #define EDITO2 400 | |
| 34 | #define EDITO3 500 | |
| 35 | #define EDITO4 600 | |
| 36 | #define EDITO5 700 | |
| 37 | #define EDITO6 800 | |
| 38 | #define UPDATE 1000 | |
| 39 | #define CREER 1002 | |
| 40 | #define CREER0 1003 | |
| 41 | #define OTXT 1005 | |
| 42 | ||
| 43 | #define MAX_O 500 // A modifié selon vos besoin. | |
| 44 | enum oinfo | |
| 45 | {
| |
| 46 | cobjetID, | |
| 47 | omodel, | |
| 48 | Float:ox, | |
| 49 | Float:oy, | |
| 50 | Float:oz, | |
| 51 | Float:orx, | |
| 52 | Float:ory, | |
| 53 | Float:orz, | |
| 54 | osave, | |
| 55 | Float:omoovex, | |
| 56 | Float:omoovey, | |
| 57 | Float:omoovez, | |
| 58 | Float:omooverx, | |
| 59 | Float:omoovery, | |
| 60 | Float:omooverz, | |
| 61 | Float:omoovespeed, | |
| 62 | oprix, | |
| 63 | otimer, | |
| 64 | Float:oradius | |
| 65 | }; | |
| 66 | new objectInfo[MAX_O][oinfo]; | |
| 67 | new texture[MAX_O][13][32], txdname[MAX_O][13][32], txtmodel[MAX_O][13]; | |
| 68 | new otexture[MAX_PLAYERS], oindex[MAX_PLAYERS]; | |
| 69 | new infoo[MAX_PLAYERS] = 0; | |
| 70 | new PlayerText3D:textl[MAX_O]; | |
| 71 | ||
| 72 | // FORWARD | |
| 73 | forward loadObject(); | |
| 74 | forward UpdateObject(object); | |
| 75 | ||
| 76 | // VARIABLES GENERALES | |
| 77 | new vargen, query[1028], commandes[256]; | |
| 78 | new NbOb=1,tmp20[12][2], objList; | |
| 79 | static Field[60][64]; | |
| 80 | /* | |
| 81 | Si editobject=1, alors le joueur déplace l'objet. | |
| 82 | Si editobjzct=2, alors le joueur crée un mooveobject. | |
| 83 | */ | |
| 84 | new editobject[MAX_PLAYERS]; | |
| 85 | new IdObject[MAX_PLAYERS]; | |
| 86 | /* | |
| 87 | Si moovemode=1, alors l'objet est à sa position d'origine | |
| 88 | Si moovemode=2, alors l'objet est à sa position après le mooveobject | |
| 89 | */ | |
| 90 | new moovemode[MAX_O]; | |
| 91 | forward timerMoove(o); | |
| 92 | ||
| 93 | public OnFilterScriptInit() | |
| 94 | {
| |
| 95 | SetGameModeText("MapCreator");
| |
| 96 | AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); | |
| 97 | mysql_connect(HOST, USER, DB, MDP); | |
| 98 | loadObject(); | |
| 99 | objList = LoadModelSelectionMenu("objects.txt");
| |
| 100 | return 1; | |
| 101 | } | |
| 102 | ||
| 103 | public OnFilterScriptExit() | |
| 104 | {
| |
| 105 | for(new o = 1;o < MAX_O;o++) UpdateObject(o); | |
| 106 | return 1; | |
| 107 | } | |
| 108 | ||
| 109 | public OnPlayerRequestClass(playerid, classid) | |
| 110 | {
| |
| 111 | SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); | |
| 112 | SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); | |
| 113 | SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); | |
| 114 | return 1; | |
| 115 | } | |
| 116 | ||
| 117 | public OnPlayerDisconnect(playerid) | |
| 118 | {
| |
| 119 | otexture[playerid]=0; | |
| 120 | return 1; | |
| 121 | } | |
| 122 | // COMMANDES | |
| 123 | ||
| 124 | CMD:ovg(playerid, params[]) | |
| 125 | {
| |
| 126 | for(new o=1;o<MAX_O;o++) | |
| 127 | {
| |
| 128 | if(IsPlayerInRangeOfPoint(playerid, objectInfo[o][oradius], objectInfo[o][ox], objectInfo[o][oy], objectInfo[o][oz])) | |
| 129 | {
| |
| 130 | if(objectInfo[o][omoovex] != 0) | |
| 131 | {
| |
| 132 | if(moovemode[o]==1) | |
| 133 | {
| |
| 134 | moovemode[o]=0; | |
| 135 | MoveDynamicObject(objectInfo[o][cobjetID], objectInfo[o][ox], objectInfo[o][oy], objectInfo[o][oz], objectInfo[o][omoovespeed], objectInfo[o][orx], objectInfo[o][ory], objectInfo[o][orz]); | |
| 136 | break; | |
| 137 | } | |
| 138 | if(moovemode[o] == 0) | |
| 139 | {
| |
| 140 | if(GetPlayerMoney(playerid) < objectInfo[o][oprix]) return SendClientMessage(playerid, BLEUCLAIR,"Votre montant d'argent est insuffisant."); | |
| 141 | moovemode[o]=1; | |
| 142 | MoveDynamicObject(objectInfo[o][cobjetID], objectInfo[o][omoovex], objectInfo[o][omoovey], objectInfo[o][omoovez], objectInfo[o][omoovespeed], objectInfo[o][omooverx], objectInfo[o][omoovery], objectInfo[o][omooverz]); | |
| 143 | if(objectInfo[o][otimer] > 0) | |
| 144 | {
| |
| 145 | SetTimerEx("timerMoove", objectInfo[o][otimer]*1000, false, "d", o);
| |
| 146 | GivePlayerMoney(playerid, -objectInfo[o][oprix]); | |
| 147 | break; | |
| 148 | } | |
| 149 | } | |
| 150 | } | |
| 151 | } | |
| 152 | } | |
| 153 | return 1; | |
| 154 | } | |
| 155 | ||
| 156 | public timerMoove(o) | |
| 157 | {
| |
| 158 | moovemode[o]=0; | |
| 159 | MoveDynamicObject(objectInfo[o][cobjetID], objectInfo[o][ox], objectInfo[o][oy], objectInfo[o][oz], objectInfo[o][omoovespeed], objectInfo[o][orx], objectInfo[o][ory], objectInfo[o][orz]); | |
| 160 | return 1; | |
| 161 | } | |
| 162 | ||
| 163 | CMD:obj(playerid, params[]) | |
| 164 | {
| |
| 165 | new service[12], proprio[8]; | |
| 166 | if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, BLEUCLAIR,"ERROR: "BLANC1"You must be an administrator."); | |
| 167 | if(sscanf(params, "s[12]I(0)S(Aucun)[8]", service, vargen, proprio)) | |
| 168 | {
| |
| 169 | SendClientMessage(playerid, BLEUCLAIR, "USAGE: "BLANC1"/obj <type> (<id>)"); | |
| 170 | SendClientMessage(playerid, BLEUCLAIR, "Type: "BLANC1"create, delet, edit, go, update, info, txt, index, copy"); | |
| 171 | return 1; | |
| 172 | } | |
| 173 | if(!strcmp(service, "create", true)) | |
| 174 | {
| |
| 175 | ShowPlayerDialog(playerid, CREER, DIALOG_STYLE_LIST, "Object Edit", "Enter the id of the object\nChoose an object from the list", "Validate", "Close"); | |
| 176 | return 1; | |
| 177 | } | |
| 178 | else if(!strcmp(service, "delet", true)) | |
| 179 | {
| |
| 180 | if(objectInfo[vargen][omodel] == 0) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"The object id is invalid."); | |
| 181 | if(objectInfo[vargen][osave] == 0) | |
| 182 | {
| |
| 183 | DestroyDynamicObject(objectInfo[vargen][cobjetID]); | |
| 184 | resetVar(vargen); | |
| 185 | format(commandes, sizeof(commandes),"Object ID: %d has been deleted.", vargen); | |
| 186 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 187 | } | |
| 188 | else if(objectInfo[vargen][osave] == 1) | |
| 189 | {
| |
| 190 | DestroyDynamicObject(objectInfo[vargen][cobjetID]); | |
| 191 | format(query, sizeof(query),"DELETE FROM objets WHERE objetID=%d", vargen); | |
| 192 | mysql_query(query); | |
| 193 | resetVar(vargen); | |
| 194 | format(commandes, sizeof(commandes),"Object ID: %d has been deleted.", vargen); | |
| 195 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 196 | } | |
| 197 | return 1; | |
| 198 | } | |
| 199 | else if(!strcmp(service, "copy",true)) | |
| 200 | {
| |
| 201 | if(objectInfo[vargen][omodel] == 0) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"The object id is invalid."); | |
| 202 | new ido=GetFreeObjectID(); | |
| 203 | new Float:posx, Float:posy, Float:posz, Float:posrx, Float:posry, Float:posrz; | |
| 204 | GetDynamicObjectPos(objectInfo[vargen][cobjetID], posx, posy, posz); | |
| 205 | GetDynamicObjectRot(objectInfo[vargen][cobjetID], posrx, posry, posrz); | |
| 206 | objectInfo[ido][omodel]=objectInfo[vargen][omodel]; | |
| 207 | objectInfo[ido][ox]=posx; | |
| 208 | objectInfo[ido][oy]=posy; | |
| 209 | objectInfo[ido][oz]=posz; | |
| 210 | objectInfo[ido][orx]=posrx; | |
| 211 | objectInfo[ido][ory]=posry; | |
| 212 | objectInfo[ido][orz]=posrz; | |
| 213 | objectInfo[ido][cobjetID]=CreateDynamicObject(objectInfo[ido][omodel], objectInfo[ido][ox], objectInfo[ido][oy], objectInfo[ido][oz], posrx, posry, posrz); | |
| 214 | for(new t=0;t < 13;t++) | |
| 215 | {
| |
| 216 | if(txtmodel[vargen][t] != 0) | |
| 217 | {
| |
| 218 | format(texture[ido][t], 32, "%s", texture[vargen][t]); | |
| 219 | format(txdname[ido][t], 32, "%s", txdname[vargen][t]); | |
| 220 | txtmodel[ido][t]=txtmodel[vargen][t]; | |
| 221 | SetDynamicObjectMaterial(objectInfo[ido][cobjetID], t, txtmodel[vargen][t], texture[vargen][t], txdname[vargen][t], 0); | |
| 222 | } | |
| 223 | } | |
| 224 | if(editobject[playerid] == 0) | |
| 225 | {
| |
| 226 | editobject[playerid]=1; | |
| 227 | IdObject[playerid]=ido; | |
| 228 | EditDynamicObject(playerid, objectInfo[IdObject[playerid]][cobjetID]); | |
| 229 | } | |
| 230 | format(commandes, 64,"Object id: %d copied.", ido); | |
| 231 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 232 | } | |
| 233 | else if(!strcmp(service, "edit", true)) | |
| 234 | {
| |
| 235 | ShowPlayerDialog(playerid, EDITO, DIALOG_STYLE_LIST,"Object Edit", "Move the object\nSave the object\nCreate a \"MoveDynamicObject\"\nChange the radius (moveobject)\nAssign a price\nAssign a timer (moveobject)\nChange the speed of the object", "Validate", "Close"); | |
| 236 | return 1; | |
| 237 | } | |
| 238 | else if(!strcmp(service, "update", true)) | |
| 239 | {
| |
| 240 | ShowPlayerDialog(playerid, UPDATE, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to be updated in the database or enter nothing to update all objects.", "Validate", "Close"); | |
| 241 | return 1; | |
| 242 | } | |
| 243 | else if(!strcmp(service, "go", true)) | |
| 244 | {
| |
| 245 | if(objectInfo[vargen][omodel] == 0) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"The object id is invalid."); | |
| 246 | SetPlayerPos(playerid, objectInfo[vargen][ox]+2, objectInfo[vargen][oy], objectInfo[vargen][oz]+1); | |
| 247 | return 1; | |
| 248 | } | |
| 249 | else if(!strcmp(service, "txt", true)) | |
| 250 | {
| |
| 251 | if(vargen == 0) return SendClientMessage(playerid, BLEUCLAIR, "USAGE: "BLANC1"/obj txt <id> <index>"); | |
| 252 | else if(!strcmp(proprio, "Aucun", true)) return SendClientMessage(playerid, BLEUCLAIR, "USAGE: "BLANC1"/obj txt <id> <index>"); | |
| 253 | if(objectInfo[vargen][omodel] == 0) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"The object id is invalid."); | |
| 254 | else if(strval(proprio) < 0 || strval(proprio) > 12) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"L'index doit être compris entre 0 et 12."); | |
| 255 | otexture[playerid]=vargen, oindex[playerid]=strval(proprio); | |
| 256 | ShowPlayerDialog(playerid, OTXT, DIALOG_STYLE_LIST, "Changing textures", "Wood\nOrange wood\nPlank\nWood forest\nFlooring\nGrass\nConcrete\nRock\nMetal\nIron\nGlasses\nWindow\nYellow and white stripes\nSheet metal\nWhite\nRed\nBlue\nOrange\nGreen\nRed tiles\nBlue tiles\nRed/Orange tiles\nLeather\nRed carpet\nGray floor\nConcrete pavers\nHexagonal pavers\nBeige pavers\nWood lath\nRock pavers\nYellowish concrete\nSquare pavers\nBlack\nNone", "Validate", "Close"); | |
| 257 | return 1; | |
| 258 | } | |
| 259 | else if(!strcmp(service, "infos", true)) | |
| 260 | {
| |
| 261 | for(new o=1;o<MAX_O;o++) | |
| 262 | {
| |
| 263 | if(infoo[playerid] == 0) | |
| 264 | {
| |
| 265 | new otext[12]; | |
| 266 | if(objectInfo[o][osave] == 0) { otext="No"; }
| |
| 267 | else if(objectInfo[o][osave] == 1) { otext="Yes"; }
| |
| 268 | format(commandes, sizeof(commandes),""BLEUCLAIR1"Object ID: "BLANC1"%d\n"BLEUCLAIR1"Model: "BLANC1"%d\n"BLEUCLAIR1"Save: "BLANC1"%s", o, objectInfo[o][omodel], otext); | |
| 269 | textl[o]=CreatePlayer3DTextLabel(playerid, commandes, BLEUCLAIR, objectInfo[o][ox], objectInfo[o][oy], objectInfo[o][oz], 30.0); | |
| 270 | } | |
| 271 | else if(infoo[playerid] == 1) | |
| 272 | {
| |
| 273 | DeletePlayer3DTextLabel(playerid, textl[o]); | |
| 274 | } | |
| 275 | } | |
| 276 | if(infoo[playerid] == 0) infoo[playerid] = 1; | |
| 277 | else if(infoo[playerid] == 1) infoo[playerid] = 0; | |
| 278 | } | |
| 279 | else if(!strcmp(service, "info", true)) | |
| 280 | {
| |
| 281 | if(editobject[playerid] != 0) return SendClientMessage(playerid, BLEUCLAIR, "INFO: "BLANC1"You do not need to be in edit mode."); | |
| 282 | SelectObject(playerid); | |
| 283 | } | |
| 284 | return 1; | |
| 285 | } | |
| 286 | ||
| 287 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
| 288 | {
| |
| 289 | switch(dialogid) | |
| 290 | {
| |
| 291 | case CREER: | |
| 292 | {
| |
| 293 | if(response) | |
| 294 | {
| |
| 295 | if(listitem == 0) | |
| 296 | {
| |
| 297 | ShowPlayerDialog(playerid, CREER0, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to create:", "Validate", "Close"); | |
| 298 | } | |
| 299 | else | |
| 300 | {
| |
| 301 | ShowModelSelectionMenu(playerid, objList, "Select an object", 0x39747aBB, 0x6b959199 , 0x97bea9AA); | |
| 302 | } | |
| 303 | } | |
| 304 | } | |
| 305 | case CREER0: | |
| 306 | {
| |
| 307 | if(response) | |
| 308 | {
| |
| 309 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, CREER0, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to create:", "Validate", "Close"); | |
| 310 | new ido=GetFreeObjectID(); | |
| 311 | new Float:posx, Float:posy, Float:posz; | |
| 312 | GetPlayerPos(playerid, posx, posy, posz); | |
| 313 | objectInfo[ido][omodel]=strval(inputtext); | |
| 314 | objectInfo[ido][ox]=posx; | |
| 315 | objectInfo[ido][oy]=posy; | |
| 316 | objectInfo[ido][oz]=posz; | |
| 317 | objectInfo[ido][cobjetID]=CreateDynamicObject(objectInfo[ido][omodel], objectInfo[ido][ox]+5, objectInfo[ido][oy], objectInfo[ido][oz], 0.0, 0.0, 0.0); | |
| 318 | if(!IsValidDynamicObject(objectInfo[ido][cobjetID])) | |
| 319 | {
| |
| 320 | resetVar(ido); | |
| 321 | DestroyDynamicObject(ido); | |
| 322 | return 1; | |
| 323 | } | |
| 324 | format(commandes, 64,"Object ID: %d create.", ido); | |
| 325 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 326 | } | |
| 327 | } | |
| 328 | case EDITO: | |
| 329 | {
| |
| 330 | if(listitem == 0) | |
| 331 | {
| |
| 332 | ShowPlayerDialog(playerid, EDITO0, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to be moved:", "Validate", "Close"); | |
| 333 | } | |
| 334 | else if(listitem == 1) | |
| 335 | {
| |
| 336 | ShowPlayerDialog(playerid, EDITO1, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to save:", "Validate", "Close"); | |
| 337 | } | |
| 338 | else if(listitem == 2) | |
| 339 | {
| |
| 340 | ShowPlayerDialog(playerid, EDITO2, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to create a moveobject\nMove then to the desired position:", "Validate", "Close"); | |
| 341 | } | |
| 342 | else if(listitem == 3) | |
| 343 | {
| |
| 344 | ShowPlayerDialog(playerid, EDITO3, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the desired radius, as follows: \"objectid, radius\"", "Validate", "Close"); | |
| 345 | } | |
| 346 | else if(listitem == 4) | |
| 347 | {
| |
| 348 | ShowPlayerDialog(playerid, EDITO4, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object and the price you want to assign as follows: \"objectid, price\" (/ovg)", "Validate", "Close"); | |
| 349 | } | |
| 350 | else if(listitem == 5) | |
| 351 | {
| |
| 352 | ShowPlayerDialog(playerid, EDITO5, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the number in second for the timer in the following form \"objectid second\"", "Validate", "Close"); | |
| 353 | } | |
| 354 | else if(listitem == 6) | |
| 355 | {
| |
| 356 | ShowPlayerDialog(playerid, EDITO6, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the desire for speed moveobject as follows \"objectid, speed\"", "Validate", "Close"); | |
| 357 | } | |
| 358 | } | |
| 359 | case EDITO0: | |
| 360 | {
| |
| 361 | if(response) | |
| 362 | {
| |
| 363 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO0, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to be moved:", "Validate", "Close"); | |
| 364 | IdObject[playerid]=strval(inputtext); | |
| 365 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 366 | {
| |
| 367 | editobject[playerid]=1; | |
| 368 | EditDynamicObject(playerid, objectInfo[IdObject[playerid]][cobjetID]); | |
| 369 | } | |
| 370 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 371 | } | |
| 372 | } | |
| 373 | case EDITO1: | |
| 374 | {
| |
| 375 | if(response) | |
| 376 | {
| |
| 377 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO1, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object in order to save", "Validate", "Close"); | |
| 378 | IdObject[playerid]=strval(inputtext); | |
| 379 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 380 | {
| |
| 381 | if(objectInfo[IdObject[playerid]][osave] == 1) return SendClientMessage(playerid, BLEUCLAIR, "The object is already stored in the database."); | |
| 382 | objectInfo[IdObject[playerid]][osave]=1; | |
| 383 | format(commandes, sizeof(commandes), "Object ID: %d saved", IdObject[playerid]); | |
| 384 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 385 | format(query, sizeof(query), "INSERT INTO objets (objetID, omodel, ox, oy, oz, orx, ory, orz, osave, omoovex, omoovey, omoovez, omooverx, omoovery, omooverz, omoovespeed, oprix, otimer, oradius) VALUES (%d, %d, '%f', '%f', '%f', '%f', '%f', '%f', 1, '%f', '%f', '%f', '%f', '%f', '%f', '%f', %d, %d, '%f')", | |
| 386 | IdObject[playerid], | |
| 387 | objectInfo[IdObject[playerid]][omodel], | |
| 388 | objectInfo[IdObject[playerid]][ox], | |
| 389 | objectInfo[IdObject[playerid]][oy], | |
| 390 | objectInfo[IdObject[playerid]][oz], | |
| 391 | objectInfo[IdObject[playerid]][orx], | |
| 392 | objectInfo[IdObject[playerid]][ory], | |
| 393 | objectInfo[IdObject[playerid]][orz], | |
| 394 | objectInfo[IdObject[playerid]][omoovex], | |
| 395 | objectInfo[IdObject[playerid]][omoovey], | |
| 396 | objectInfo[IdObject[playerid]][omoovez], | |
| 397 | objectInfo[IdObject[playerid]][omooverx], | |
| 398 | objectInfo[IdObject[playerid]][omoovery], | |
| 399 | objectInfo[IdObject[playerid]][omooverz], | |
| 400 | objectInfo[IdObject[playerid]][omoovespeed], | |
| 401 | objectInfo[IdObject[playerid]][oprix], | |
| 402 | objectInfo[IdObject[playerid]][otimer], | |
| 403 | objectInfo[IdObject[playerid]][oradius]); | |
| 404 | mysql_query(query); | |
| 405 | } | |
| 406 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 407 | } | |
| 408 | } | |
| 409 | case EDITO2: | |
| 410 | {
| |
| 411 | if(response) | |
| 412 | {
| |
| 413 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO2, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object to create a moveobject\nMove then to the desired position:", "Validate", "Close"); | |
| 414 | IdObject[playerid]=strval(inputtext); | |
| 415 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 416 | {
| |
| 417 | SendClientMessage(playerid, BLEUCLAIR, "Moving the object to the position or the object moves."); | |
| 418 | editobject[playerid]=2; | |
| 419 | EditDynamicObject(playerid, objectInfo[IdObject[playerid]][cobjetID]); | |
| 420 | } | |
| 421 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 422 | } | |
| 423 | } | |
| 424 | case EDITO3: | |
| 425 | {
| |
| 426 | if(response) | |
| 427 | {
| |
| 428 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO3, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the desired radius, as follows: \"objectid, radius\"", "Validate", "Close"); | |
| 429 | split(inputtext, tmp20, ','); | |
| 430 | IdObject[playerid]=strval(tmp20[0]); | |
| 431 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 432 | {
| |
| 433 | if(objectInfo[IdObject[playerid]][omoovex] == 0) return SendClientMessage(playerid, BLEUCLAIR, "First create a move-object to assign a radius (/ovg)"); | |
| 434 | if(strfind(inputtext, ",") == -1) return SendClientMessage(playerid, BLEUCLAIR, "Model invalid"); | |
| 435 | objectInfo[IdObject[playerid]][oradius]=floatstr(tmp20[1]); | |
| 436 | format(commandes, sizeof(commandes),"The radius of the object id: %d was changed to %f", IdObject[playerid], objectInfo[IdObject[playerid]][oradius]); | |
| 437 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 438 | } | |
| 439 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 440 | } | |
| 441 | } | |
| 442 | case EDITO4: | |
| 443 | {
| |
| 444 | if(response) | |
| 445 | {
| |
| 446 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO4, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object and the price you want to assign as follows: \"objectid, price\" (/ovg)", "Validate", "Close"); | |
| 447 | split(inputtext, tmp20, ','); | |
| 448 | IdObject[playerid]=strval(tmp20[0]); | |
| 449 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 450 | {
| |
| 451 | if(objectInfo[IdObject[playerid]][omoovex] == 0) return SendClientMessage(playerid, BLEUCLAIR, "First create a move-object to assign a radius (/ovg)"); | |
| 452 | if(strfind(inputtext, ",") == -1) return SendClientMessage(playerid, BLEUCLAIR, "Model invalid"); | |
| 453 | else if(strfind(inputtext, ".") != -1) return SendClientMessage(playerid, BLEUCLAIR, "Enter an integer."); | |
| 454 | objectInfo[IdObject[playerid]][oprix]=strval(tmp20[1]); | |
| 455 | format(commandes, sizeof(commandes),"The price of the object id: %d was changed to %d $", IdObject[playerid], objectInfo[IdObject[playerid]][oprix]); | |
| 456 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 457 | } | |
| 458 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 459 | } | |
| 460 | } | |
| 461 | case EDITO5: | |
| 462 | {
| |
| 463 | if(response) | |
| 464 | {
| |
| 465 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO5, DIALOG_STYLE_INPUT,"Object Edit", "Entrez l'id de l'objet suivi du nombre en seconde pour le timer (/ovg)", "Validate", "Close"); | |
| 466 | split(inputtext, tmp20, ','); | |
| 467 | IdObject[playerid]=strval(tmp20[0]); | |
| 468 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 469 | {
| |
| 470 | if(objectInfo[IdObject[playerid]][omoovex] == 0) return SendClientMessage(playerid, BLEUCLAIR, "First create a move-object to assign a radius (/ovg)"); | |
| 471 | if(strfind(inputtext, ",") == -1) return SendClientMessage(playerid, BLEUCLAIR, "Model invalid"); | |
| 472 | objectInfo[IdObject[playerid]][otimer]=strval(tmp20[1]); | |
| 473 | format(commandes, sizeof(commandes),"The timer object id: %d was changed to %d seconds", IdObject[playerid], objectInfo[IdObject[playerid]][otimer]); | |
| 474 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 475 | } | |
| 476 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 477 | } | |
| 478 | } | |
| 479 | case EDITO6: | |
| 480 | {
| |
| 481 | if(response) | |
| 482 | {
| |
| 483 | if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, EDITO6, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the desire for speed moveobject as follows \"objectid, speed\"", "Validate", "Close"); | |
| 484 | split(inputtext, tmp20, ','); | |
| 485 | IdObject[playerid]=strval(tmp20[0]); | |
| 486 | if(objectInfo[IdObject[playerid]][omodel] != 0) | |
| 487 | {
| |
| 488 | if(objectInfo[IdObject[playerid]][omoovex] == 0) return SendClientMessage(playerid, BLEUCLAIR, "First create a move-object to assign a radius."); | |
| 489 | if(strfind(inputtext, ",") == -1) return SendClientMessage(playerid, BLEUCLAIR, "Invalid model"); | |
| 490 | objectInfo[IdObject[playerid]][omoovespeed]=floatstr(tmp20[1]); | |
| 491 | format(commandes, sizeof(commandes),"The speed of the object id: %d was changed to %f", IdObject[playerid], objectInfo[IdObject[playerid]][omoovespeed]); | |
| 492 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 493 | } | |
| 494 | else return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 495 | } | |
| 496 | } | |
| 497 | case UPDATE: | |
| 498 | {
| |
| 499 | if(response) | |
| 500 | {
| |
| 501 | if(strlen(inputtext) == 0) | |
| 502 | {
| |
| 503 | for(new object=1;object<MAX_O+1;object++) | |
| 504 | {
| |
| 505 | if(objectInfo[object][osave] == 1) | |
| 506 | {
| |
| 507 | UpdateObject(object); | |
| 508 | } | |
| 509 | } | |
| 510 | } | |
| 511 | else | |
| 512 | {
| |
| 513 | IdObject[playerid]=strval(inputtext); | |
| 514 | if(objectInfo[IdObject[playerid]][osave] == 0) return SendClientMessage(playerid, BLEUCLAIR, "The ID entered is invalid"); | |
| 515 | UpdateObject(IdObject[playerid]); | |
| 516 | format(commandes, sizeof(commandes),"Object ID: %d updated in the database", IdObject[playerid]); | |
| 517 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 518 | return 1; | |
| 519 | } | |
| 520 | } | |
| 521 | } | |
| 522 | case OTXT: | |
| 523 | {
| |
| 524 | if(!response) return otexture[playerid]=0; | |
| 525 | else if(response) | |
| 526 | {
| |
| 527 | switch(listitem) | |
| 528 | {
| |
| 529 | case 0: | |
| 530 | {
| |
| 531 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "cj_lightwood"); | |
| 532 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 533 | txtmodel[otexture[playerid]][oindex[playerid]]=19356; | |
| 534 | } | |
| 535 | case 1: | |
| 536 | {
| |
| 537 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "gym_floor5"); | |
| 538 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 539 | txtmodel[otexture[playerid]][oindex[playerid]]=19360; | |
| 540 | } | |
| 541 | case 2: | |
| 542 | {
| |
| 543 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "mp_diner_woodwall"); | |
| 544 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 545 | txtmodel[otexture[playerid]][oindex[playerid]]=19366; | |
| 546 | } | |
| 547 | case 3: | |
| 548 | {
| |
| 549 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "CJ_SLATEDWOOD"); | |
| 550 | format(texture[otexture[playerid]][oindex[playerid]], 32, "break_street2"); | |
| 551 | txtmodel[otexture[playerid]][oindex[playerid]]=1452; | |
| 552 | } | |
| 553 | case 4: | |
| 554 | {
| |
| 555 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "mp_shop_floor2"); | |
| 556 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 557 | txtmodel[otexture[playerid]][oindex[playerid]]=19370; | |
| 558 | } | |
| 559 | case 5: | |
| 560 | {
| |
| 561 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "desgreengrass"); | |
| 562 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 563 | txtmodel[otexture[playerid]][oindex[playerid]]=19381; | |
| 564 | } | |
| 565 | case 6: | |
| 566 | {
| |
| 567 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "cj_white_wall2"); | |
| 568 | format(texture[otexture[playerid]][oindex[playerid]], 32, "all_walls"); | |
| 569 | txtmodel[otexture[playerid]][oindex[playerid]]=19357; | |
| 570 | } | |
| 571 | case 7: | |
| 572 | {
| |
| 573 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "rocktb128"); | |
| 574 | format(texture[otexture[playerid]][oindex[playerid]], 32, "weemap"); | |
| 575 | txtmodel[otexture[playerid]][oindex[playerid]]=3930; | |
| 576 | } | |
| 577 | case 8: | |
| 578 | {
| |
| 579 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "CJ_FLIGHT_CASE"); | |
| 580 | format(texture[otexture[playerid]][oindex[playerid]], 32, "cj_crate_will"); | |
| 581 | txtmodel[otexture[playerid]][oindex[playerid]]=964; | |
| 582 | } | |
| 583 | case 9: | |
| 584 | {
| |
| 585 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "liftdoorsac256"); | |
| 586 | format(texture[otexture[playerid]][oindex[playerid]], 32, "lift_drx"); | |
| 587 | txtmodel[otexture[playerid]][oindex[playerid]]=3051; | |
| 588 | } | |
| 589 | case 10: | |
| 590 | {
| |
| 591 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "lsmall_window01"); | |
| 592 | format(texture[otexture[playerid]][oindex[playerid]], 32, "lsmall_shops"); | |
| 593 | txtmodel[otexture[playerid]][oindex[playerid]]=19466; | |
| 594 | } | |
| 595 | case 11: | |
| 596 | {
| |
| 597 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "carshowglass_sfsx"); | |
| 598 | format(texture[otexture[playerid]][oindex[playerid]], 32, "ws_carshowwin1"); | |
| 599 | txtmodel[otexture[playerid]][oindex[playerid]]=3851; | |
| 600 | } | |
| 601 | case 12: | |
| 602 | {
| |
| 603 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "chevron64HVa"); | |
| 604 | format(texture[otexture[playerid]][oindex[playerid]], 32, "vegasairprtland"); | |
| 605 | txtmodel[otexture[playerid]][oindex[playerid]]=7890; | |
| 606 | } | |
| 607 | case 13: | |
| 608 | {
| |
| 609 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "drvin_front"); | |
| 610 | format(texture[otexture[playerid]][oindex[playerid]], 32, "des_byoffice"); | |
| 611 | txtmodel[otexture[playerid]][oindex[playerid]]=16501; | |
| 612 | } | |
| 613 | case 14: | |
| 614 | {
| |
| 615 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "white"); | |
| 616 | format(texture[otexture[playerid]][oindex[playerid]], 32, "matcolours"); | |
| 617 | txtmodel[otexture[playerid]][oindex[playerid]]=18646; | |
| 618 | } | |
| 619 | case 15: | |
| 620 | {
| |
| 621 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "red"); | |
| 622 | format(texture[otexture[playerid]][oindex[playerid]], 32, "matcolours"); | |
| 623 | txtmodel[otexture[playerid]][oindex[playerid]]=18646; | |
| 624 | } | |
| 625 | case 16: | |
| 626 | {
| |
| 627 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "blue"); | |
| 628 | format(texture[otexture[playerid]][oindex[playerid]], 32, "matcolours"); | |
| 629 | txtmodel[otexture[playerid]][oindex[playerid]]=18646; | |
| 630 | } | |
| 631 | case 17: | |
| 632 | {
| |
| 633 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "orange"); | |
| 634 | format(texture[otexture[playerid]][oindex[playerid]], 32, "matcolours"); | |
| 635 | txtmodel[otexture[playerid]][oindex[playerid]]=18646; | |
| 636 | } | |
| 637 | case 18: | |
| 638 | {
| |
| 639 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "green"); | |
| 640 | format(texture[otexture[playerid]][oindex[playerid]], 32, "matcolours"); | |
| 641 | txtmodel[otexture[playerid]][oindex[playerid]]=18646; | |
| 642 | } | |
| 643 | case 19: | |
| 644 | {
| |
| 645 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "ab_rollmat01"); | |
| 646 | format(texture[otexture[playerid]][oindex[playerid]], 32, "genintint_gym"); | |
| 647 | txtmodel[otexture[playerid]][oindex[playerid]]=2631; | |
| 648 | } | |
| 649 | case 20: | |
| 650 | {
| |
| 651 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "ab_rollmat02"); | |
| 652 | format(texture[otexture[playerid]][oindex[playerid]], 32, "genintint_gym"); | |
| 653 | txtmodel[otexture[playerid]][oindex[playerid]]=2632; | |
| 654 | } | |
| 655 | case 21: | |
| 656 | {
| |
| 657 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "GB_rugbedroom01"); | |
| 658 | format(texture[otexture[playerid]][oindex[playerid]], 32, "gb_bedrmrugs01"); | |
| 659 | txtmodel[otexture[playerid]][oindex[playerid]]=2818; | |
| 660 | } | |
| 661 | case 22: | |
| 662 | {
| |
| 663 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "CJ-COUCHL1"); | |
| 664 | format(texture[otexture[playerid]][oindex[playerid]], 32, "cj_sofa"); | |
| 665 | txtmodel[otexture[playerid]][oindex[playerid]]=2293; | |
| 666 | } | |
| 667 | case 23: | |
| 668 | {
| |
| 669 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "redFabric"); | |
| 670 | format(texture[otexture[playerid]][oindex[playerid]], 32, "cj_office"); | |
| 671 | txtmodel[otexture[playerid]][oindex[playerid]]=2168; | |
| 672 | } | |
| 673 | case 24: | |
| 674 | {
| |
| 675 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "greyground256"); | |
| 676 | format(texture[otexture[playerid]][oindex[playerid]], 32, "capitol_lawn"); | |
| 677 | txtmodel[otexture[playerid]][oindex[playerid]]=5823; | |
| 678 | } | |
| 679 | case 25: | |
| 680 | {
| |
| 681 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "conc_slabgrey_256128"); | |
| 682 | format(texture[otexture[playerid]][oindex[playerid]], 32, "sunrise09_lawn"); | |
| 683 | txtmodel[otexture[playerid]][oindex[playerid]]=5887; | |
| 684 | } | |
| 685 | case 26: | |
| 686 | {
| |
| 687 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "ws_nicepave"); | |
| 688 | format(texture[otexture[playerid]][oindex[playerid]], 32, "law2_roadsb"); | |
| 689 | txtmodel[otexture[playerid]][oindex[playerid]]=6322; | |
| 690 | } | |
| 691 | case 27: | |
| 692 | {
| |
| 693 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "crazy paving"); | |
| 694 | format(texture[otexture[playerid]][oindex[playerid]], 32, "law_beach2"); | |
| 695 | txtmodel[otexture[playerid]][oindex[playerid]]=6199; | |
| 696 | } | |
| 697 | case 28: | |
| 698 | {
| |
| 699 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "pier69_ground1"); | |
| 700 | format(texture[otexture[playerid]][oindex[playerid]], 32, "pier_law"); | |
| 701 | txtmodel[otexture[playerid]][oindex[playerid]]=6189; | |
| 702 | } | |
| 703 | case 29: | |
| 704 | {
| |
| 705 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "crazypave"); | |
| 706 | format(texture[otexture[playerid]][oindex[playerid]], 32, "lawwhitebuilds"); | |
| 707 | txtmodel[otexture[playerid]][oindex[playerid]]=6203; | |
| 708 | } | |
| 709 | case 30: | |
| 710 | {
| |
| 711 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "luxorwall01_128"); | |
| 712 | format(texture[otexture[playerid]][oindex[playerid]], 32, "lawartg"); | |
| 713 | txtmodel[otexture[playerid]][oindex[playerid]]=6205; | |
| 714 | } | |
| 715 | case 31: | |
| 716 | {
| |
| 717 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "paveslab1"); | |
| 718 | format(texture[otexture[playerid]][oindex[playerid]], 32, "sunst18_lawn"); | |
| 719 | txtmodel[otexture[playerid]][oindex[playerid]]=5999; | |
| 720 | } | |
| 721 | case 32: | |
| 722 | {
| |
| 723 | format(txdname[otexture[playerid]][oindex[playerid]], 32, "black32"); | |
| 724 | format(texture[otexture[playerid]][oindex[playerid]], 32, "des_stownmain2"); | |
| 725 | txtmodel[otexture[playerid]][oindex[playerid]]=16005; | |
| 726 | } | |
| 727 | case 33: | |
| 728 | {
| |
| 729 | format(txdname[otexture[playerid]][oindex[playerid]], 32, " "); | |
| 730 | format(texture[otexture[playerid]][oindex[playerid]], 32, " "); | |
| 731 | txtmodel[otexture[playerid]][oindex[playerid]]=0; | |
| 732 | } | |
| 733 | } | |
| 734 | SetDynamicObjectMaterial(objectInfo[otexture[playerid]][cobjetID], oindex[playerid], txtmodel[otexture[playerid]][oindex[playerid]], texture[otexture[playerid]][oindex[playerid]], txdname[otexture[playerid]][oindex[playerid]], 0); | |
| 735 | ||
| 736 | } | |
| 737 | } | |
| 738 | } | |
| 739 | return 0; | |
| 740 | } | |
| 741 | ||
| 742 | ||
| 743 | public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) | |
| 744 | {
| |
| 745 | new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ; | |
| 746 | GetDynamicObjectPos(objectid, oldX, oldY, oldZ); | |
| 747 | GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ); | |
| 748 | if(response == EDIT_RESPONSE_FINAL) | |
| 749 | {
| |
| 750 | new string[128]; | |
| 751 | if(editobject[playerid] == 1) | |
| 752 | {
| |
| 753 | objectInfo[IdObject[playerid]][ox]=x; | |
| 754 | objectInfo[IdObject[playerid]][oy]=y; | |
| 755 | objectInfo[IdObject[playerid]][oz]=z; | |
| 756 | objectInfo[IdObject[playerid]][orx]=rx; | |
| 757 | objectInfo[IdObject[playerid]][ory]=ry; | |
| 758 | objectInfo[IdObject[playerid]][orz]=rz; | |
| 759 | SetDynamicObjectPos(objectInfo[IdObject[playerid]][cobjetID], objectInfo[IdObject[playerid]][ox], objectInfo[IdObject[playerid]][oy], objectInfo[IdObject[playerid]][oz]); | |
| 760 | SetDynamicObjectRot(objectInfo[IdObject[playerid]][cobjetID],objectInfo[IdObject[playerid]][orx], objectInfo[IdObject[playerid]][ory], objectInfo[IdObject[playerid]][orz]); | |
| 761 | format(string, sizeof(string),"Object ID: %d successfully moved", IdObject[playerid]); | |
| 762 | SendClientMessage(playerid, BLEUCLAIR, string); | |
| 763 | editobject[playerid]=0; | |
| 764 | } | |
| 765 | if(editobject[playerid] == 2) | |
| 766 | {
| |
| 767 | moovemode[IdObject[playerid]]=0; | |
| 768 | objectInfo[IdObject[playerid]][omoovex]=x; | |
| 769 | objectInfo[IdObject[playerid]][omoovey]=y; | |
| 770 | objectInfo[IdObject[playerid]][omoovez]=z; | |
| 771 | objectInfo[IdObject[playerid]][omooverx]=rx; | |
| 772 | objectInfo[IdObject[playerid]][omoovery]=ry; | |
| 773 | objectInfo[IdObject[playerid]][omooverz]=rz; | |
| 774 | objectInfo[IdObject[playerid]][omoovespeed]=3.0; | |
| 775 | format(string, sizeof(string),"Move-object successfully created on the object ID: %d",IdObject[playerid]); | |
| 776 | SendClientMessage(playerid, BLEUCLAIR, string); | |
| 777 | MoveDynamicObject(objectInfo[IdObject[playerid]][cobjetID], objectInfo[IdObject[playerid]][ox], objectInfo[IdObject[playerid]][oy], objectInfo[IdObject[playerid]][oz], objectInfo[IdObject[playerid]][omoovespeed], objectInfo[IdObject[playerid]][orx], objectInfo[IdObject[playerid]][ory], objectInfo[IdObject[playerid]][orz]); | |
| 778 | editobject[playerid]=0; | |
| 779 | ShowPlayerDialog(playerid, EDITO3, DIALOG_STYLE_INPUT,"Object Edit", "Enter the id of the object followed by the desired radius, as follows: \"objectid, radius\"", "Validate", "Close"); | |
| 780 | } | |
| 781 | } | |
| 782 | else if(response == EDIT_RESPONSE_CANCEL) | |
| 783 | {
| |
| 784 | SetDynamicObjectPos(objectid, oldX, oldY, oldZ); | |
| 785 | SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ); | |
| 786 | } | |
| 787 | return 1; | |
| 788 | } | |
| 789 | ||
| 790 | ||
| 791 | public OnPlayerModelSelection(playerid, response, listid, modelid) | |
| 792 | {
| |
| 793 | if(listid == objList) | |
| 794 | {
| |
| 795 | if(!response) return HideModelSelectionMenu(playerid); | |
| 796 | else | |
| 797 | {
| |
| 798 | new ido=GetFreeObjectID(); | |
| 799 | new Float:posx, Float:posy, Float:posz; | |
| 800 | GetPlayerPos(playerid, posx, posy, posz); | |
| 801 | objectInfo[ido][omodel]=modelid; | |
| 802 | objectInfo[ido][ox]=posx; | |
| 803 | objectInfo[ido][oy]=posy; | |
| 804 | objectInfo[ido][oz]=posz; | |
| 805 | objectInfo[ido][cobjetID]=CreateDynamicObject(objectInfo[ido][omodel], objectInfo[ido][ox]+5, objectInfo[ido][oy], objectInfo[ido][oz], 0.0, 0.0, 0.0); | |
| 806 | format(commandes, 64,"Object ID: %d created.", ido); | |
| 807 | SendClientMessage(playerid, BLEUCLAIR, commandes); | |
| 808 | } | |
| 809 | } | |
| 810 | return 1; | |
| 811 | } | |
| 812 | stock GetFreeObjectID() | |
| 813 | {
| |
| 814 | for(new i = 1; i < MAX_O; i++) | |
| 815 | {
| |
| 816 | if(objectInfo[i][omodel] == 0) return i; | |
| 817 | } | |
| 818 | return -1; | |
| 819 | } | |
| 820 | ||
| 821 | public loadObject() | |
| 822 | {
| |
| 823 | new resultline[1024]; | |
| 824 | mysql_query("SELECT * FROM objets");
| |
| 825 | mysql_store_result(); | |
| 826 | if(!mysql_num_rows()) | |
| 827 | {
| |
| 828 | print("Impossible de récuperer les informations de la table \"objets\"");
| |
| 829 | mysql_free_result(); | |
| 830 | return 0; | |
| 831 | } | |
| 832 | while(mysql_fetch_row(resultline)==1) | |
| 833 | {
| |
| 834 | split(resultline, Field, '|'); | |
| 835 | NbOb=strval(Field[0]); | |
| 836 | objectInfo[NbOb][omodel]=strval(Field[1]); | |
| 837 | objectInfo[NbOb][ox]=floatstr(Field[2]); | |
| 838 | objectInfo[NbOb][oy]=floatstr(Field[3]); | |
| 839 | objectInfo[NbOb][oz]=floatstr(Field[4]); | |
| 840 | objectInfo[NbOb][orx]=floatstr(Field[5]); | |
| 841 | objectInfo[NbOb][ory]=floatstr(Field[6]); | |
| 842 | objectInfo[NbOb][orz]=floatstr(Field[7]); | |
| 843 | objectInfo[NbOb][osave]=strval(Field[8]); | |
| 844 | objectInfo[NbOb][omoovex]=floatstr(Field[9]); | |
| 845 | objectInfo[NbOb][omoovey]=floatstr(Field[10]); | |
| 846 | objectInfo[NbOb][omoovez]=floatstr(Field[11]); | |
| 847 | objectInfo[NbOb][omooverx]=floatstr(Field[12]); | |
| 848 | objectInfo[NbOb][omoovery]=floatstr(Field[13]); | |
| 849 | objectInfo[NbOb][omooverz]=floatstr(Field[14]); | |
| 850 | objectInfo[NbOb][omoovespeed]=floatstr(Field[15]); | |
| 851 | objectInfo[NbOb][oprix]=strval(Field[16]); | |
| 852 | objectInfo[NbOb][otimer]=strval(Field[17]); | |
| 853 | objectInfo[NbOb][oradius]=floatstr(Field[18]); | |
| 854 | format(txdname[NbOb][0], 32, "%s", Field[19]); | |
| 855 | format(texture[NbOb][0], 32, "%s", Field[20]); | |
| 856 | txtmodel[NbOb][0]=strval(Field[21]); | |
| 857 | format(txdname[NbOb][1], 32, "%s", Field[22]); | |
| 858 | format(texture[NbOb][1], 32, "%s", Field[23]); | |
| 859 | txtmodel[NbOb][1]=strval(Field[24]); | |
| 860 | format(txdname[NbOb][2], 32, "%s", Field[25]); | |
| 861 | format(texture[NbOb][2], 32, "%s", Field[26]); | |
| 862 | txtmodel[NbOb][2]=strval(Field[27]); | |
| 863 | format(txdname[NbOb][3], 32, "%s", Field[28]); | |
| 864 | format(texture[NbOb][3], 32, "%s", Field[29]); | |
| 865 | txtmodel[NbOb][3]=strval(Field[30]); | |
| 866 | format(txdname[NbOb][4], 32, "%s", Field[31]); | |
| 867 | format(texture[NbOb][4], 32, "%s", Field[32]); | |
| 868 | txtmodel[NbOb][4]=strval(Field[33]); | |
| 869 | format(txdname[NbOb][5], 32, "%s", Field[34]); | |
| 870 | format(texture[NbOb][5], 32, "%s", Field[35]); | |
| 871 | txtmodel[NbOb][5]=strval(Field[36]); | |
| 872 | format(txdname[NbOb][6], 32, "%s", Field[37]); | |
| 873 | format(texture[NbOb][6], 32, "%s", Field[38]); | |
| 874 | txtmodel[NbOb][6]=strval(Field[39]); | |
| 875 | format(txdname[NbOb][7], 32, "%s", Field[40]); | |
| 876 | format(texture[NbOb][7], 32, "%s", Field[41]); | |
| 877 | txtmodel[NbOb][7]=strval(Field[42]); | |
| 878 | format(txdname[NbOb][8], 32, "%s", Field[43]); | |
| 879 | format(texture[NbOb][8], 32, "%s", Field[44]); | |
| 880 | txtmodel[NbOb][8]=strval(Field[45]); | |
| 881 | format(txdname[NbOb][9], 32, "%s", Field[46]); | |
| 882 | format(texture[NbOb][9], 32, "%s", Field[47]); | |
| 883 | txtmodel[NbOb][9]=strval(Field[48]); | |
| 884 | format(txdname[NbOb][10], 32, "%s", Field[49]); | |
| 885 | format(texture[NbOb][10], 32, "%s", Field[50]); | |
| 886 | txtmodel[NbOb][10]=strval(Field[51]); | |
| 887 | format(txdname[NbOb][11], 32, "%s", Field[52]); | |
| 888 | format(texture[NbOb][11], 32, "%s", Field[53]); | |
| 889 | txtmodel[NbOb][11]=strval(Field[54]); | |
| 890 | format(txdname[NbOb][12], 32, "%s", Field[55]); | |
| 891 | format(texture[NbOb][12], 32, "%s", Field[56]); | |
| 892 | txtmodel[NbOb][12]=strval(Field[57]); | |
| 893 | objectInfo[NbOb][cobjetID]=CreateDynamicObject(objectInfo[NbOb][omodel], objectInfo[NbOb][ox], objectInfo[NbOb][oy], objectInfo[NbOb][oz], objectInfo[NbOb][orx], objectInfo[NbOb][ory], objectInfo[NbOb][orz]); | |
| 894 | for(new t=0;t < 13;t++) | |
| 895 | {
| |
| 896 | if(txtmodel[NbOb][t] != 0) | |
| 897 | {
| |
| 898 | SetDynamicObjectMaterial(objectInfo[NbOb][cobjetID], t, txtmodel[NbOb][t], texture[NbOb][t], txdname[NbOb][t], 0); | |
| 899 | } | |
| 900 | } | |
| 901 | } | |
| 902 | NbOb=1; | |
| 903 | print("|====> Object loaded system.");
| |
| 904 | mysql_free_result(); | |
| 905 | return 1; | |
| 906 | } | |
| 907 | ||
| 908 | ||
| 909 | stock resetVar(objectid) | |
| 910 | {
| |
| 911 | objectInfo[objectid][cobjetID]=0; | |
| 912 | objectInfo[objectid][omodel]=0; | |
| 913 | objectInfo[objectid][ox]=0; | |
| 914 | objectInfo[objectid][oy]=0; | |
| 915 | objectInfo[objectid][oz]=0; | |
| 916 | objectInfo[objectid][orx]=0; | |
| 917 | objectInfo[objectid][ory]=0; | |
| 918 | objectInfo[objectid][orz]=0; | |
| 919 | objectInfo[objectid][osave]=0; | |
| 920 | objectInfo[objectid][omoovex]=0; | |
| 921 | objectInfo[objectid][omoovey]=0; | |
| 922 | objectInfo[objectid][omoovez]=0; | |
| 923 | objectInfo[objectid][omooverx]=0; | |
| 924 | objectInfo[objectid][omoovery]=0; | |
| 925 | objectInfo[objectid][omooverz]=0; | |
| 926 | objectInfo[objectid][omoovespeed]=0; | |
| 927 | objectInfo[objectid][oprix]=0; | |
| 928 | objectInfo[objectid][otimer]=0; | |
| 929 | objectInfo[objectid][oradius]=0; | |
| 930 | for(new t=0;t < 13;t++) | |
| 931 | {
| |
| 932 | txdname[objectid][t]=" "; | |
| 933 | texture[objectid][t]=" "; | |
| 934 | txtmodel[objectid][t]=0; | |
| 935 | } | |
| 936 | return 1; | |
| 937 | } | |
| 938 | ||
| 939 | public UpdateObject(object) | |
| 940 | {
| |
| 941 | if(objectInfo[object][omodel] == 0) return 1; | |
| 942 | format(query, sizeof(query), "UPDATE objets SET omodel=%d, ox='%f', oy='%f', oz='%f', orx='%f', ory='%f', orz='%f', osave=%d, omoovex='%f', omoovey='%f', omoovez='%f', omooverx='%f', omoovery='%f', omooverz='%f', omoovespeed='%f', oprix=%d, otimer=%d, oradius='%f' WHERE objetID=%d", | |
| 943 | objectInfo[object][omodel], | |
| 944 | objectInfo[object][ox], | |
| 945 | objectInfo[object][oy], | |
| 946 | objectInfo[object][oz], | |
| 947 | objectInfo[object][orx], | |
| 948 | objectInfo[object][ory], | |
| 949 | objectInfo[object][orz], | |
| 950 | objectInfo[object][osave], | |
| 951 | objectInfo[object][omoovex], | |
| 952 | objectInfo[object][omoovey], | |
| 953 | objectInfo[object][omoovez], | |
| 954 | objectInfo[object][omooverx], | |
| 955 | objectInfo[object][omoovery], | |
| 956 | objectInfo[object][omooverz], | |
| 957 | objectInfo[object][omoovespeed], | |
| 958 | objectInfo[object][oprix], | |
| 959 | objectInfo[object][otimer], | |
| 960 | objectInfo[object][oradius], | |
| 961 | object); | |
| 962 | mysql_query(query); | |
| 963 | format(query, sizeof(query), "UPDATE objets SET txdname0='%s', texture0='%s', txtmodel0=%d, txdname1='%s', texture1='%s', txtmodel1=%d, txdname2='%s', texture2='%s', txtmodel2=%d, txdname3='%s', texture3='%s', txtmodel3=%d, txdname4='%s', texture4='%s', txtmodel4=%d, txdname5='%s', texture5='%s', txtmodel5=%d, txdname6='%s', texture6='%s', txtmodel6=%d WHERE objetID=%d", | |
| 964 | txdname[object][0], | |
| 965 | texture[object][0], | |
| 966 | txtmodel[object][0], | |
| 967 | txdname[object][1], | |
| 968 | texture[object][1], | |
| 969 | txtmodel[object][1], | |
| 970 | txdname[object][2], | |
| 971 | texture[object][2], | |
| 972 | txtmodel[object][2], | |
| 973 | txdname[object][3], | |
| 974 | texture[object][3], | |
| 975 | txtmodel[object][3], | |
| 976 | txdname[object][4], | |
| 977 | texture[object][4], | |
| 978 | txtmodel[object][4], | |
| 979 | txdname[object][5], | |
| 980 | texture[object][5], | |
| 981 | txtmodel[object][5], | |
| 982 | txdname[object][6], | |
| 983 | texture[object][6], | |
| 984 | txtmodel[object][6], | |
| 985 | object); | |
| 986 | mysql_query(query); | |
| 987 | format(query, sizeof(query), "UPDATE objets SET txdname7='%s', texture7='%s', txtmodel7=%d, txdname8='%s', texture8='%s', txtmodel8=%d, txdname9='%s', texture9='%s', txtmodel9=%d, txdname10='%s', texture10='%s', txtmodel10=%d, txdname11='%s', texture11='%s', txtmodel11=%d, txdname12='%s', texture12='%s', txtmodel12=%d WHERE objetID=%d", | |
| 988 | txdname[object][7], | |
| 989 | texture[object][7], | |
| 990 | txtmodel[object][7], | |
| 991 | txdname[object][8], | |
| 992 | texture[object][8], | |
| 993 | txtmodel[object][8], | |
| 994 | txdname[object][9], | |
| 995 | texture[object][9], | |
| 996 | txtmodel[object][9], | |
| 997 | txdname[object][10], | |
| 998 | texture[object][10], | |
| 999 | txtmodel[object][10], | |
| 1000 | txdname[object][11], | |
| 1001 | texture[object][11], | |
| 1002 | txtmodel[object][11], | |
| 1003 | txdname[object][12], | |
| 1004 | texture[object][12], | |
| 1005 | txtmodel[object][12], | |
| 1006 | object); | |
| 1007 | mysql_query(query); | |
| 1008 | return 1; | |
| 1009 | } | |
| 1010 | ||
| 1011 | stock split(const strsrc[], strdest[][], delimiter) | |
| 1012 | {
| |
| 1013 | new i, li; | |
| 1014 | new aNum; | |
| 1015 | new len; | |
| 1016 | while(i <= strlen(strsrc)) | |
| 1017 | {
| |
| 1018 | if(strsrc[i] == delimiter || i == strlen(strsrc)) | |
| 1019 | {
| |
| 1020 | len = strmid(strdest[aNum], strsrc, li, i, 128); | |
| 1021 | strdest[aNum][len] = 0; | |
| 1022 | li = i+1; | |
| 1023 | aNum++; | |
| 1024 | } | |
| 1025 | i++; | |
| 1026 | } | |
| 1027 | return 1; | |
| 1028 | } |