· 9 years ago · Dec 27, 2016, 02:07 AM
1///////////// Enum
2
3enum customTextEnum
4{
5 bool:ctExists,
6 ctString[255],
7 ctColor,
8 ctFont[32],
9 Float:ctX,
10 Float:ctY,
11 Float:ctZ,
12 Float:ctRX,
13 Float:ctRY,
14 Float:ctRZ,
15 ctSize,
16 ctModel,
17 ctBackColor,
18 ctObjectID
19};
20new CustomTextEnum[MAX_CUSTOM_TEXTS][customTextEnum];
21new DB:CustomTextDB;
22
23//////// OnGameModeInit
24
25
26CustomTextDB = db_open("CustomTexts.db");
27 db_query(CustomTextDB, "CREATE TABLE IF NOT EXISTS `CustomTexts` (`ctID` DEFAULT 0, `ctString` DEFAULT 0, `ctColor` DEFAULT 0, `ctFont` DEFAULT 0, `ctX` DEFAULT 0, `ctY` DEFAULT 0, `ctZ` DEFAULT 0, `ctRX` DEFAULT 0, `ctRY` DEFAULT 0, `ctRZ` DEFAULT 0, `ctSize` DEFAULT 0, `ctBackColor` DEFAULT 0)");
28 LoadCustomTexts();
29
30//////// Něco v dcmd OnPlayerCommandText
31
32
33 if (strcmp(cmd, "/createcustomtext", true) == 0)
34 {
35 if (PlayerInfo[playerid][pAdmin] >= 1337)
36 {
37 tmp = strtok(cmdtext, idx);
38 if (!strlen(tmp))
39 {
40 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /createcustomtext [text]");
41 return 1;
42 }
43 strmid(tmp, cmdtext, strfind(cmdtext, " ") + 1, strlen(cmdtext));
44 for (new i = 0; i < MAX_CUSTOM_TEXTS; i ++)
45 {
46 if (!CustomTextEnum[i][ctExists])
47 {
48 new Float:x, Float:y, Float:z, Float:a;
49 GetPlayerPos(playerid, x, y, z);
50 GetPlayerFacingAngle(playerid, a);
51
52 x += (4.0 * floatsin(-a, degrees));
53 y += (4.0 * floatcos(a, degrees));
54 z += 5.5;
55
56 CustomTextEnum[i][ctExists] = true;
57 format(CustomTextEnum[i][ctString], 255, tmp);
58 CustomTextEnum[i][ctColor] = 0xFF000000;
59 format(CustomTextEnum[i][ctFont], 32, "Arial");
60
61 CustomTextEnum[i][ctX] = x;
62 CustomTextEnum[i][ctY] = y;
63 CustomTextEnum[i][ctZ] = z;
64 CustomTextEnum[i][ctRX] = 0.0;
65 CustomTextEnum[i][ctRY] = 0.0;
66 CustomTextEnum[i][ctRZ] = a - 180;
67 CustomTextEnum[i][ctObjectID] = CreateDynamicObject(2885, x, y, z, 0.0, 0.0, a);
68 CustomTextEnum[i][ctSize] = 24;
69 CustomTextEnum[i][ctModel] = 2885;
70 CustomTextEnum[i][ctBackColor] = 0xFFFFFFFF;
71
72 SetDynamicObjectMaterialText(CustomTextEnum[i][ctObjectID], 0, Wrap(tmp), _, _, _, _, 0xFF000000, 0xFFFFFFFF, 1);
73
74 format(string, sizeof(string), "You have created a custom text (ID: %d).", i);
75 SendClientMessage(playerid, -1, string);
76
77 format(string, sizeof(string), "INSERT INTO `CustomTexts` (`ctID`) VALUES('%d')", i);
78 db_query(CustomTextDB, string);
79
80 SaveCustomText(i);
81 return 1;
82 }
83 }
84 SendClientMessage(playerid, 0xAFAFAFFF, "You cannot spawn any more custom texts.");
85 return 1;
86 }
87 else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
88 return 1;
89 }
90 if (strcmp(cmd, "/editcustomtext", true) == 0)
91 {
92 if (PlayerInfo[playerid][pAdmin] >= 1337)
93 {
94 tmp = strtok(cmdtext, idx);
95 if (!strlen(tmp))
96 {
97 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [name] [value]");
98 SendClientMessage(playerid, 0xFFFFFFFF, "Available names: location, text, color, backcolor, font, object, size");
99 return 1;
100 }
101 new id = strval(tmp);
102 if (id < 0 || id > sizeof(CustomTextEnum) - 1)
103 {
104 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
105 return 1;
106 }
107 if (!CustomTextEnum[id][ctExists])
108 {
109 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
110 return 1;
111 }
112 tmp = strtok(cmdtext, idx);
113 if (!strlen(tmp))
114 {
115 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [name] [value]");
116 SendClientMessage(playerid, 0xFFFFFFFF, "Available names: location, text, color, backcolor, font, object, size");
117 return 1;
118 }
119 if (strcmp(tmp, "location", true) == 0)
120 {
121 new Float:x, Float:y, Float:z, Float:a;
122 GetPlayerPos(playerid, x, y, z);
123 GetPlayerFacingAngle(playerid, a);
124
125 x += (2.0 * floatsin(-a, degrees));
126 y += (2.0 * floatcos(a, degrees));
127 z += 5.5;
128
129 CustomTextEnum[id][ctX] = x;
130 CustomTextEnum[id][ctY] = y;
131 CustomTextEnum[id][ctZ] = z;
132 CustomTextEnum[id][ctRZ] = a;
133
134 SetDynamicObjectPos(CustomTextEnum[id][ctObjectID], x, y, z);
135 SetDynamicObjectRot(CustomTextEnum[id][ctObjectID], 0.0, 0.0, a - 180);
136
137 SaveCustomText(id);
138 format(string, sizeof(string), "You have adjusted the location for custom text #%d.", id);
139 SendClientMessage(playerid, -1, string);
140 return 1;
141 }
142 if (strcmp(tmp, "text", true) == 0)
143 {
144 cmdtext[strfind(cmdtext, " ")] = '\\';
145 cmdtext[strfind(cmdtext, " ")] = '\\';
146 if (strfind(cmdtext, " ", false) == -1)
147 {
148 SendClientMessage(playerid, -1, "USAGE: /editcustomtext [id] [text] [custom text]");
149 return 1;
150 }
151 strmid(tmp, cmdtext, strfind(cmdtext, " ") + 1, strlen(cmdtext));
152
153 format(CustomTextEnum[id][ctString], 255, tmp);
154 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
155
156 SaveCustomText(id);
157 format(string, sizeof(string), "You have adjusted the text to %s for custom text #%d.", tmp, id);
158 SendClientMessage(playerid, -1, string);
159 return 1;
160 }
161 if (strcmp(tmp, "color", true) == 0)
162 {
163 tmp = strtok(cmdtext, idx);
164 if (!strlen(tmp) || strlen(tmp) != 10)
165 {
166 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [color] [name]");
167 SendClientMessage(playerid, 0xFF6347FF, "The color must be in this format: 0xFFFF00FF.");
168 return 1;
169 }
170 if (tmp[0] != '0' && tmp[1] != 'x')
171 {
172 SendClientMessage(playerid, 0xFFFFFFFF, "The color must be in this format: 0xFFFF00FF.");
173 return 1;
174 }
175 new chars[4];
176 strmid(chars, tmp, 8, 10);
177 strdel(tmp, 8, 10);
178 strins(tmp, chars, 2);
179 CustomTextEnum[id][ctColor] = ShiftRGBAToABGR(HexToInt(tmp));
180
181 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
182
183 SaveCustomText(id);
184 format(string, sizeof(string), "You have adjusted the color to %d for custom text #%d.", CustomTextEnum[id][ctColor], id);
185 SendClientMessage(playerid, -1, string);
186 return 1;
187 }
188 if (strcmp(tmp, "backcolor", true) == 0)
189 {
190 tmp = strtok(cmdtext, idx);
191 if (!strlen(tmp))
192 {
193 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [backcolor] [background color]");
194 return 1;
195 }
196 new chars[4];
197 strmid(chars, tmp, 8, 10);
198 strdel(tmp, 8, 10);
199 strins(tmp, chars, 2);
200 CustomTextEnum[id][ctBackColor] = ShiftRGBAToABGR(HexToInt(tmp));
201 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
202
203 SaveCustomText(id);
204 format(string, sizeof(string), "You have adjusted the background color to %d for custom text #%d.", CustomTextEnum[id][ctBackColor], id);
205 SendClientMessage(playerid, -1, string);
206 return 1;
207 }
208 if (strcmp(tmp, "size", true) == 0)
209 {
210 tmp = strtok(cmdtext, idx);
211 if (!strlen(tmp))
212 {
213 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [size] [text size]");
214 return 1;
215 }
216 CustomTextEnum[id][ctSize] = strval(tmp);
217 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
218
219 SaveCustomText(id);
220 format(string, sizeof(string), "You have adjusted the size to %d for custom text #%d.", strval(tmp), id);
221 SendClientMessage(playerid, -1, string);
222 return 1;
223 }
224 if (strcmp(tmp, "object", true) == 0)
225 {
226 tmp = strtok(cmdtext, idx);
227 if (!strlen(tmp))
228 {
229 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [object] [text object]");
230 return 1;
231 }
232 CustomTextEnum[id][ctModel] = strval(tmp);
233 DestroyDynamicObject(CustomTextEnum[id][ctObjectID]);
234 CustomTextEnum[id][ctObjectID] = CreateDynamicObject(CustomTextEnum[id][ctModel], CustomTextEnum[id][ctX], CustomTextEnum[id][ctY], CustomTextEnum[id][ctZ], CustomTextEnum[id][ctRX], CustomTextEnum[id][ctRY], CustomTextEnum[id][ctRZ]);
235 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
236
237 SaveCustomText(id);
238 format(string, sizeof(string), "You have adjusted the size to %d for custom text #%d.", strval(tmp), id);
239 SendClientMessage(playerid, -1, string);
240 return 1;
241 }
242 if (strcmp(tmp, "font", true) == 0)
243 {
244 tmp = strtok(cmdtext, idx);
245 if (!strlen(tmp))
246 {
247 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editcustomtext [id] [font] [text font]");
248 return 1;
249 }
250 format(CustomTextEnum[id][ctFont], 32, tmp);
251 SetDynamicObjectMaterialText(CustomTextEnum[id][ctObjectID], 0, Wrap(CustomTextEnum[id][ctString]), _, CustomTextEnum[id][ctFont], CustomTextEnum[id][ctSize], 1, CustomTextEnum[id][ctColor], CustomTextEnum[id][ctBackColor], 1);
252
253 SaveCustomText(id);
254 format(string, sizeof(string), "You have adjusted the font to %s for custom text #%d.", tmp, strval(tmp), id);
255 SendClientMessage(playerid, -1, string);
256 return 1;
257 }
258 }
259 else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
260 return 1;
261 }
262 if (strcmp(cmd, "/deletecustomtext", true) == 0)
263 {
264 if (PlayerInfo[playerid][pAdmin] >= 1337)
265 {
266 tmp = strtok(cmdtext, idx);
267 if (!strlen(tmp))
268 {
269 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /deletecustomtext [id]");
270 return 1;
271 }
272 new id = strval(tmp);
273 if (id < 0 || id > sizeof(CustomTextEnum) - 1)
274 {
275 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
276 return 1;
277 }
278 if (!CustomTextEnum[id][ctExists])
279 {
280 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
281 return 1;
282 }
283 CustomTextEnum[id][ctExists] = false;
284 DestroyDynamicObject(CustomTextEnum[id][ctObjectID]);
285
286 format(string, sizeof(string), "DELETE FROM `CustomTexts` WHERE `ctID` = '%d'", id);
287 db_query(CustomTextDB, string);
288
289 format(string, sizeof(string), "You have deleted a custom (ID: %d).", id);
290 SendClientMessage(playerid, -1, string);
291 return 1;
292 }
293 else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
294 return 1;
295 }
296 if (strcmp(cmd, "/cteditor", true) == 0)
297 {
298 if (PlayerInfo[playerid][pAdmin] >= 1337)
299 {
300 tmp = strtok(cmdtext, idx);
301 if (!strlen(tmp))
302 {
303 SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /deletecustomtext [id]");
304 return 1;
305 }
306 new id = strval(tmp);
307 if (id < 0 || id > sizeof(CustomTextEnum) - 1)
308 {
309 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
310 return 1;
311 }
312 if (!CustomTextEnum[id][ctExists])
313 {
314 SendClientMessage(playerid, 0xAFAFAFFF, "Invalid custom text ID.");
315 return 1;
316 }
317 SetPVarInt(playerid, "EditCustomText", id + 1);
318 EditDynamicObject(playerid, CustomTextEnum[id][ctObjectID]);
319 format(string, sizeof(string), "You are now editing custom text #%d.", id);
320 SendClientMessage(playerid, -1, string);
321 return 1;
322 }
323 else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
324 return 1;
325 }
326 if (strcmp(cmd, "/customtext", true) == 0)
327 {
328 if (PlayerInfo[playerid][pAdmin] >= 1337)
329 {
330 for (new i = 0; i < MAX_CUSTOM_TEXTS; i ++)
331 {
332 if (CustomTextEnum[i][ctExists] && IsPlayerInRangeOfPoint(playerid, 5.0, CustomTextEnum[i][ctX], CustomTextEnum[i][ctY], CustomTextEnum[i][ctZ]))
333 {
334 format(string, sizeof(string), "You are standing near custom text ID: %d.", i);
335 SendClientMessage(playerid, -1, string);
336 return 1;
337 }
338 }
339 SendClientMessage(playerid, 0xAFAFAFFF, "You are not standing near any custom text.");
340 return 1;
341 }
342 else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
343 return 1;
344 }
345
346/////////////////// Něco v OnPlayerDynamicObjectEdit (musi se vytvořit) něco tu vyber co patřà k Customtext
347
348public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
349{
350 new
351 Float:oldX,
352 Float:oldY,
353 Float:oldZ,
354 Float:oldRotX,
355 Float:oldRotY,
356 Float:oldRotZ;
357
358 GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
359 GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
360 if(!IsValidDynamicObject(objectid)) return 0;
361 MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
362
363 if(response == EDIT_RESPONSE_FINAL)
364 {
365 SetDynamicObjectPos(objectid, x, y, z);
366 SetDynamicObjectRot(objectid, rx, ry, rz);
367 if (GetPVarInt(playerid, "ObjectEditor") != 0)
368 {
369 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objX] = x;
370 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objY] = y;
371 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objZ] = z;
372 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRX] = rx;
373 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRY] = ry;
374 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRZ] = rz;
375 DeletePVar(playerid, "ObjectEditor");
376 SaveObjects();
377 }
378 if (GetPVarInt(playerid, "GateEditor") != 0)
379 {
380 GateInfo[GetPVarInt(playerid, "GateEditor")][gateX] = x;
381 GateInfo[GetPVarInt(playerid, "GateEditor")][gateY] = y;
382 GateInfo[GetPVarInt(playerid, "GateEditor")][gateZ] = z;
383 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotX] = rx;
384 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotY] = ry;
385 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotZ] = rz;
386 DeletePVar(playerid, "GateEditor");
387 SaveGates();
388 }
389 if (GetPVarInt(playerid, "FacGateEditor") != 0)
390 {
391 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateX] = x;
392 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateY] = y;
393 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateZ] = z;
394 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotX] = rx;
395 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotY] = ry;
396 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotZ] = rz;
397 DeletePVar(playerid, "FacGateEditor");
398 SaveFacGates();
399 }
400 if (GetPVarInt(playerid, "FamGateEditor") != 0)
401 {
402 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateX] = x;
403 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateY] = y;
404 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateZ] = z;
405 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotX] = rx;
406 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotY] = ry;
407 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotZ] = rz;
408 DeletePVar(playerid, "FamGateEditor");
409 SaveFamGates();
410 }
411 new ct;
412 if ((ct = GetPVarInt(playerid, "EditCustomText")) != 0)
413 {
414 ct--;
415 CustomTextEnum[ct][ctX] = x;
416 CustomTextEnum[ct][ctY] = y;
417 CustomTextEnum[ct][ctZ] = z;
418 CustomTextEnum[ct][ctRX] = rx;
419 CustomTextEnum[ct][ctRY] = ry;
420 CustomTextEnum[ct][ctRZ] = rz;
421
422 SetDynamicObjectPos(CustomTextEnum[ct][ctObjectID], x, y, z);
423 SetDynamicObjectRot(CustomTextEnum[ct][ctObjectID], rx, ry, rz);
424 DeletePVar(playerid, "EditCustomText");
425 SaveCustomText(ct);
426 }
427 }
428
429 if(response == EDIT_RESPONSE_CANCEL)
430 {
431 SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
432 SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
433
434 if (GetPVarInt(playerid, "ObjectEditor") != 0)
435 {
436 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objX] = oldX;
437 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objY] = oldY;
438 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objZ] = oldZ;
439 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRX] = oldRotX;
440 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRY] = oldRotY;
441 ObjectInfo[GetPVarInt(playerid, "ObjectEditor")][objRZ] = oldRotZ;
442 DeletePVar(playerid, "ObjectEditor");
443 }
444 if (GetPVarInt(playerid, "GateEditor") != 0)
445 {
446 GateInfo[GetPVarInt(playerid, "GateEditor")][gateX] = oldX;
447 GateInfo[GetPVarInt(playerid, "GateEditor")][gateY] = oldY;
448 GateInfo[GetPVarInt(playerid, "GateEditor")][gateZ] = oldZ;
449 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotX] = oldRotX;
450 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotY] = oldRotY;
451 GateInfo[GetPVarInt(playerid, "GateEditor")][gateRotZ] = oldRotZ;
452 DeletePVar(playerid, "GateEditor");
453 }
454 if (GetPVarInt(playerid, "FacGateEditor") != 0)
455 {
456 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateX] = oldX;
457 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateY] = oldY;
458 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateZ] = oldZ;
459 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotX] = oldRotX;
460 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotY] = oldRotY;
461 FacGateInfo[GetPVarInt(playerid, "FacGateEditor")][FacGateRotZ] = oldRotZ;
462 DeletePVar(playerid, "FacGateEditor");
463 }
464 if (GetPVarInt(playerid, "FamGateEditor") != 0)
465 {
466 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateX] = oldX;
467 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateY] = oldY;
468 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateZ] = oldZ;
469 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotX] = oldRotX;
470 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotY] = oldRotY;
471 FamGateInfo[GetPVarInt(playerid, "FamGateEditor")][FamGateRotZ] = oldRotZ;
472 DeletePVar(playerid, "FamGateEditor");
473 }
474 if (GetPVarInt(playerid, "EditCustomText") != 0)
475 {
476 DeletePVar(playerid, "EditCustomText");
477 }
478 SendClientMessage(playerid, -1, "You have cancelled the object edition.");
479 }
480 return 1;
481}
482
483/////////////////////// To se tam nÄ›kde použÃvá taky.
484stock Wrap(string[])
485{
486 new
487 j,
488 length,
489 ret[128];
490
491 format(ret, sizeof(ret), string);
492 length = strlen(ret);
493 while (j < length)
494 {
495 j++;
496 if (!(j % 20))
497 {
498 for (new h = j; h < j + 10; h ++)
499 {
500 if (ret[h] == ' ')
501 {
502 strins(ret, "\n", h);
503 break;
504 }
505 }
506 }
507 }
508 return ret;
509}