· 8 years ago · Mar 17, 2018, 06:44 PM
1#include <a_samp>
2#include <streamer>
3#include <foreach>
4new bool:truckcheck[MAX_PLAYERS];
5new deliveringfor[MAX_PLAYERS];
6new nearshop[MAX_PLAYERS];
7new inshop[MAX_PLAYERS];
8enum stuff3
9{
10 inpickup,
11 Text3D: txt,
12 Text3D: ownr,
13 namef[60],
14 ownerf[60]
15};
16new shopproper[MAX_PLAYERS][stuff3];
17public OnGameModeInit()
18{
19 new shops, tmp2[60], str[128];
20 result = db_query(Database, "SELECT * FROM `Shops`");
21 shops = db_num_rows(result);
22 printf("Loading %d shops...", shops);
23 allshops = shops;
24 while (shops > 0)
25 {
26 db_get_field_assoc(result,"shopid",tmp2,sizeof(tmp2));
27 id = strval(tmp2);
28 db_get_field_assoc(result,"name",tmp2,sizeof(tmp2));
29 format(shopproper[id][namef], 51, "%s", tmp2);
30 db_get_field_assoc(result,"owner",tmp2,sizeof(tmp2));
31 format(shopproper[id][ownerf], 52, "%s", tmp2);
32 db_get_field_assoc(result,"x",tmp2,sizeof(tmp2));
33 x = floatstr(tmp2);
34 db_get_field_assoc(result,"y",tmp2,sizeof(tmp2));
35 y = floatstr(tmp2);
36 db_get_field_assoc(result,"z",tmp2,sizeof(tmp2));
37 z = floatstr(tmp2);
38 shopproper[id][inpickup] = CreateDynamicPickup(1275, 1, x, y, z, 0);
39 format(str, sizeof(str), "OWNER: %s", shopproper[id][namef]);
40 shopproper[id][txt] = CreateDynamic3DTextLabel(str, 0xAD3939FF, x, y, z-0.4, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
41 shopproper[id][ownr] = CreateDynamic3DTextLabel(shopproper[id][ownerf], 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
42 db_next_row(result);
43 shops--;
44 }
45 return 1;
46}
47public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
48{
49 new str[125], Float:x1, Float:y1, Float:z1, interiorid, vw, DBResult:result;
50 new Float:x2, Float:y2, Float:z2, msg2[256];
51 if((newkeys & KEY_YES) && nearshop[playerid] != -1)
52 {
53 format(str, sizeof(str), "SELECT * FROM `Shops` WHERE `shopid` = %d", nearshop[playerid]);
54 result = db_query(Database, str);
55 db_get_field_assoc(result,"x1",str,sizeof(str));
56 x1 = floatstr(str);
57 db_get_field_assoc(result,"y1",str,sizeof(str));
58 y1 = floatstr(str);
59 db_get_field_assoc(result,"z1",str,sizeof(str));
60 z1 = floatstr(str);
61 db_get_field_assoc(result,"interiorid",str,sizeof(str));
62 interiorid = strval(str);
63 db_get_field_assoc(result,"vw",str,sizeof(str));
64 vw = strval(str);
65 SetPlayerInterior(playerid, interiorid);
66 SetPlayerVirtualWorld(playerid, vw);
67 SetPlayerPos(playerid, x1, y1, z1);
68 inshop[playerid] = nearshop[playerid];
69 format(msg2, sizeof(msg2), "You are now inshop id %d", inshop[playerid]);
70 SendClientMessage(playerid, ERRORCOLOR, msg2);
71 SetTimerEx("nearshoprm", 500, false, "i", playerid);
72 }
73 if((newkeys & KEY_YES) && inshop[playerid] != -1)
74 {
75 format(str, sizeof(str), "SELECT * FROM `Shops` WHERE `shopid` = %d", inshop[playerid]);
76 result = db_query(Database, str);
77 db_get_field_assoc(result,"x",str,sizeof(str));
78 x1 = floatstr(str);
79 db_get_field_assoc(result,"y",str,sizeof(str));
80 y1 = floatstr(str);
81 db_get_field_assoc(result,"z",str,sizeof(str));
82 z1 = floatstr(str);
83 db_get_field_assoc(result,"x2",str,sizeof(str));
84 x2 = floatstr(str);
85 db_get_field_assoc(result,"y2",str,sizeof(str));
86 y2 = floatstr(str);
87 db_get_field_assoc(result,"z2",str,sizeof(str));
88 z2 = floatstr(str);
89 if(IsPlayerInRangeOfPoint(playerid, 3, x2, y2, z2) && inshop[playerid] != -1)
90 {
91 SetPlayerInterior(playerid, 0);
92 SetPlayerVirtualWorld(playerid, 0);
93 SetPlayerPos(playerid, x1, y1, z1);
94 nearshop[playerid] = -1;
95 inshop[playerid] = -1;
96 }
97 }
98 return 1;
99}
100//
101db_query(Database, "CREATE TABLE IF NOT EXISTS `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`,`vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`)");
102//
103CMD:removeshop(playerid, params[])
104{
105 new str[147];
106 if (!AdminCheck(playerid, 5)) return 0;
107 if (nearshop[playerid] == -1) return SendClientMessage(playerid, ERRORCOLOR, "You are not close enough to any shop");
108 format(str, sizeof(str), "DELETE FROM `Shops` WHERE `shopid` = %d", nearshop[playerid]);
109 db_query(Database, str);
110 DestroyDynamicPickup(shopproper[nearshop[playerid]][inpickup]);
111 allshops--;
112 format(str, sizeof(str), "%s has deleted shop (ID:%d)", Name[playerid], nearshop[playerid]);
113 SendMessageToAdmins(4, str);
114 return 1;
115}
116CMD:addshop(playerid, params[])
117{
118 new Float:x, Float:y, Float:z, type;
119 new Float:x1, Float:y1, Float:z1, shopid, name[30], str[128];
120 new vw, DBResult:result, query[1000], Float:facingang;
121 if(!AdminCheck(playerid, 4)) return 0;
122// if(sscanf(params, "iiiffffff", vw, interiorid, pric,x1,y1,z1, x2,y2,z2)) return SendClientMessage(playerid, ERRORCOLOR, "Usage: /addshop [vw] [interiorid] [price] [x] [y] [z] [x2] [y2] [z2]");
123 if(sscanf(params, "is[30]", type, name)) return SendClientMessage(playerid, ERRORCOLOR, "Usage: /addshop [type] [name]");
124 GetPlayerPos(playerid, x,y,z);
125 GetPlayerFacingAngle(playerid, facingang);
126 for (new i = 0; i < MAX_SHOPS; i++)
127 {
128 format(query, sizeof(query), "SELECT * FROM `Shops` WHERE `shopid` = %d", i);
129 result = db_query(Database, query);
130 if (db_num_rows(result) == 0)
131 {
132 shopid = i;
133 break;
134 }
135 db_free_result(result);
136 }
137 for (new m = 0; m < MAX_SHOPS; m++)
138 {
139 format(query, sizeof(query), "SELECT * FROM `Shops` WHERE `vw` = %d", m);
140 result = db_query(Database, query);
141 if (db_num_rows(result) == 0)
142 {
143 vw = m;
144 break;
145 }
146 db_free_result(result);
147 }
148 if(type == 1)
149 {
150 format(query, sizeof(query),"INSERT INTO `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`, `vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`) VALUES (%d, %.2f, %.2f, %.2f, '%s', -1,%d, 7, '%s', 314.820983, -141.431991, 999.601562,314.820983, -141.431991, 999.601562, %.2f)", shopid, x, y, z, DB_Escape(name), vw, DB_Escape(Name[playerid]), facingang);
151 db_query(Database, query);
152 format(query, sizeof(query), "%s has created a shop with name %s(ID:%d) type: Ammunation 3, exit points : %.2f ,%.2f ,%.2f", Name[playerid], name, shopid, x1, y1, z1);
153 SendMessageToAdmins(5, query);
154 shopproper[shopid][inpickup] = CreateDynamicPickup(1275, 1,x, y, z);
155 shopproper[shopid][txt] = CreateDynamic3DTextLabel(name, 0xAD3939FF, x, y, z-0.3, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
156 format(str, sizeof(str), "{D490CE}OWNER: %s", Name[playerid]);
157 shopproper[shopid][ownr] = CreateDynamic3DTextLabel(str, 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
158 }
159 else if(type == 2)
160 {
161 format(query, sizeof(query),"INSERT INTO `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`, `vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`) VALUES (%d, %.2f, %.2f, %.2f, '%s', -1,%d, 7, '%s', 314.820983, -141.431991, 999.601562,314.820983, -141.431991, 999.601562, %.2f)", shopid, x, y, z, DB_Escape(name), vw, DB_Escape(Name[playerid]), facingang);
162 db_query(Database, query);
163 format(query, sizeof(query), "%s has created a shop with name %s(ID:%d) type: Ammunation 4, exit points : %.2f ,%.2f ,%.2f", Name[playerid], name, shopid, x1, y1, z1);
164 SendMessageToAdmins(5, query);
165 shopproper[shopid][inpickup] = CreateDynamicPickup(1275, 1,x, y, z);
166 shopproper[shopid][txt] = CreateDynamic3DTextLabel(name, 0xAD3939FF, x, y, z-0.3, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
167 format(str, sizeof(str), "{D490CE}OWNER: %s", Name[playerid]);
168 shopproper[shopid][ownr] = CreateDynamic3DTextLabel(str, 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
169 allshops++;
170 }
171 else if(type == 3)
172 {
173 format(query, sizeof(query),"INSERT INTO `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`, `vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`) VALUES (%d, %.2f, %.2f, %.2f, '%s', -1,%d, 7, '%s', 314.820983, -141.431991, 999.601562,314.820983, -141.431991, 999.601562, %.2f)", shopid, x, y, z, DB_Escape(name), vw, DB_Escape(Name[playerid]), facingang);
174 db_query(Database, query);
175 format(query, sizeof(query), "%s has created a shop with name %s(ID:%d) type: Ammunation 4, exit points : %.2f ,%.2f ,%.2f", Name[playerid], name, shopid, x1, y1, z1);
176 SendMessageToAdmins(5, query);
177 shopproper[shopid][inpickup] = CreateDynamicPickup(1275, 1,x, y, z);
178 shopproper[shopid][txt] = CreateDynamic3DTextLabel(name, 0xAD3939FF, x, y, z-0.3, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
179 format(str, sizeof(str), "{D490CE}OWNER: %s", Name[playerid]);
180 shopproper[shopid][ownr] = CreateDynamic3DTextLabel(str, 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
181 allshops++;
182 }
183 else if(type == 4)
184 {
185 format(query, sizeof(query),"INSERT INTO `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`, `vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`) VALUES (%d, %.2f, %.2f, %.2f, '%s', -1,%d, 7, '%s', 314.820983, -141.431991, 999.601562,314.820983, -141.431991, 999.601562, %.2f)", shopid, x, y, z, DB_Escape(name), vw, DB_Escape(Name[playerid]), facingang);
186 db_query(Database, query);
187 format(query, sizeof(query), "%s has created a shop with name %s(ID:%d) type: Ammunation 4, exit points : %.2f ,%.2f ,%.2f", Name[playerid], name, shopid, x1, y1, z1);
188 SendMessageToAdmins(5, query);
189 shopproper[shopid][inpickup] = CreateDynamicPickup(1275, 1,x, y, z);
190 shopproper[shopid][txt] = CreateDynamic3DTextLabel(name, 0xAD3939FF, x, y, z-0.3, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
191 format(str, sizeof(str), "{D490CE}OWNER: %s", Name[playerid]);
192 shopproper[shopid][ownr] = CreateDynamic3DTextLabel(str, 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
193 allshops++;
194 }
195 else if(type == 5)
196 {
197 format(query, sizeof(query),"INSERT INTO `Shops` (`shopid`, `x`, `y`, `z`, `name`, `price`, `vw`, `interiorid`, `owner`, `x1`, `y1`, `z1`,`x2`, `y2`, `z2`, `facingan`) VALUES (%d, %.2f, %.2f, %.2f, '%s', -1,%d, 7, '%s', 314.820983, -141.431991, 999.601562,314.820983, -141.431991, 999.601562, %.2f)", shopid, x, y, z, DB_Escape(name), vw, DB_Escape(Name[playerid]), facingang);
198 db_query(Database, query);
199 format(query, sizeof(query), "%s has created a shop with name %s(ID:%d) type: Ammunation 4, exit points : %.2f ,%.2f ,%.2f", Name[playerid], name, shopid, x1, y1, z1);
200 SendMessageToAdmins(5, query);
201 shopproper[shopid][inpickup] = CreateDynamicPickup(1275, 1,x, y, z);
202 shopproper[shopid][txt] = CreateDynamic3DTextLabel(name, 0xAD3939FF, x, y, z-0.3, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
203 format(str, sizeof(str), "{D490CE}OWNER: %s", Name[playerid]);
204 shopproper[shopid][ownr] = CreateDynamic3DTextLabel(str, 0xD490CEFF, x, y, z-0.5, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0);
205 allshops++;
206 }
207 return 1;
208}
209CMD:buyshop(playerid, params[])
210{
211 new query[500], price, DBResult: result;
212 if(nearshop[playerid] == -1) return SendClientMessage(playerid, ERRORCOLOR, "You are not near any shop");
213 format(query, sizeof(query), "SELECT * FROM `Shops` WHERE `shopid` = %d", nearshop[playerid])
214 result = db_query(Database, query);
215 db_get_field_assoc(result,"price",query,sizeof(query));
216 price = strval(query);
217 if(price == -1) return SendClientMessage(playerid, ERRORCOLOR, "This shop is not saled");
218 if(GetPlayerMoney(playerid) < price) return SendClientMessage(playerid, ERRORCOLOR, "invalid amount");
219 format(query, sizeof(query), "UPDATE `Shops` SET `owner` = '%s', `price` = %d WHERE `shopid` = %d", DB_Escape(Name[playerid]), -1, nearshop[playerid]);
220 db_query(Database, query);
221 SetPlayerMoney(playerid, GetPlayerMoney(playerid) - price);
222 SendClientMessage(playerid, -1, "Pruchase completed");
223 return 1;
224}
225CMD:sale(playerid, params[])
226{
227 new query[500], price, DBResult: result, owner[82];
228 if(sscanf(params, "i", price)) return SendClientMessage(playerid, ERRORCOLOR, "Usage: /sale [price]");
229 if(inshop[playerid] == -1) return SendClientMessage(playerid, ERRORCOLOR, "You are not in any shop");
230 format(query, sizeof(query), "SELECT * FROM `Shops` WHERE `shopid` = %d", in[playerid]);
231 result = db_query(Database, query);
232 db_get_field_assoc(result,"owner",query,sizeof(query));
233 format(owner, sizeof(owner),"%s", query);
234 if(strcmp(Name[playerid], "owner", false) == 0) return SendClientMessage(playerid, ERRORCOLOR, "You don't own this shop");
235 format(query, sizeof(query), "UDPATE `Shops` SET `price` = %d WHERE `shopid` = %d", price,inshop[playerid]);
236 db_query(Database, query);
237 return 1;
238}
239IRCCMD:setname(botid, channel[], user[], host[], params[])
240{
241 if (!IRC_IsAdmin(botid, channel, user)) return 1;
242 new DBResult: result, oldname[30], newname[30], msg[256], find[500], id;
243 if (strlen(params) > 41) return IRC_SendMessageToAdmins(4, "4Either the old or new name is too long.");
244 if (sscanf(params, "s[30]s[30]", oldname, newname)) return IRC_SendMessageToAdmins(4, "4Usage: !setname [oldname or playerid] [newname]");
245 if (strlen(newname) < 3) return IRC_SendMessageToAdmins(4, "4The new name is too short.");
246 if (newname[0] <= '9' && newname[0] >= '0') return IRC_SendMessageToAdmins(4, "4The new name is too short.");
247 if (strlen(oldname) > 20 || strlen(newname) > 20) return IRC_SendMessageToAdmins(4, "4Either the old or new name is too long.");
248 if (strfind(newname, " ", true, 0) != -1) return IRC_SendMessageToAdmins(4, "4Invalid name.");
249 format(msg, sizeof(msg), "SELECT * FROM `User` WHERE `Name` = '%s'", DB_Escape(newname));
250 result = db_query(Database, msg);
251 if (db_num_rows(result))
252 {
253 db_free_result(result);
254 return IRC_SendMessageToAdmins(4, "4This name is already regisered.");
255 }
256 db_free_result(result);
257 if (IsNumeric(oldname))
258 {
259 id = strval(oldname);
260 if (!IsPlayerConnected(id)) return IRC_SendMessageToAdmins(4, "4Invalid playerid.");
261 if (!logged_{id}) return IRC_SendMessageToAdmins(4, "4This player is not registerd.");
262 format(oldname, sizeof(oldname), "%s", Name[id]);
263 if (strcmp(newname, oldname, true) == 0) return IRC_SendMessageToAdmins(4, "4Current name and new name may not be the same.");
264 SetPlayerName(id, newname);
265 format(Name[id], 24, "%s", newname);
266 format(msg, sizeof(msg), "An Admin has changed your name to %s", newname);
267 SendClientMessage(id, 0xFFFF00FF, msg);
268 }
269 else
270 {
271 format(msg, sizeof(msg), "SELECT * FROM `User` WHERE `Name` = '%s'", DB_Escape(oldname));
272 result = db_query(Database, msg);
273 if (!db_num_rows(result))
274 {
275 db_free_result(result);
276 return IRC_SendMessageToAdmins(4, "4This player is not registerd.");
277 }
278 id = GetPlayerID(oldname);
279 if (IsPlayerConnected(id)) if (!logged_{id}) return IRC_SendMessageToAdmins(4, "4This player is not registerd.");
280 if (strcmp(newname, oldname, true) == 0) return IRC_SendMessageToAdmins(4, "4Current name and new name may not be the same.");
281 }
282 if (IsPlayerConnected(id)) { SetPlayerName(id, newname); format(Name[id], 24, "%s", newname); }
283 format(find, sizeof(find), "SELECT * FROM `Shops` WHERE `owner` = '%s'", oldname);
284 esult = db_query(Database, find);
285 if(db_num_rows(result))
286 {
287 format(find, sizeof(find), "UPDATE `Shops` SET `owner` = '%s' WHERE `owner` = '%s'",DB_Escape(newname), DB_Escape(oldname));
288 db_query(Database, query);
289 }
290 format(msg, sizeof(msg), "UPDATE `User` SET `Name` = '%s' WHERE `Name` = '%s'",DB_Escape(newname), DB_Escape(oldname));
291 db_query(Database, msg);
292 format(msg, sizeof(msg), "%s has changed the name %s to %s", user, oldname, newname);
293 SendMessageToAdmins(4, msg);
294 strins(msg, "10", 0);
295 IRC_SendMessageToAdmins(4, msg);
296 return 1;
297}
298public OnPlayerExitVehicle(playerid, vehicleid)
299{
300 switch(GetVehicleModel(vehicleid))
301 {
302 case 455, 515:
303 {
304 SendClientMessage(playerid, ERRORCOLOR, "you are no longer on trucker duty");
305 DisablePlayerCheckpoint(playerid);
306 deliveringfor[playerid] = -1;
307 truckcheck[playerid] = false;
308 }
309 }
310}
311public OnPlayerStateChange(playerid, oldstate, newstate)
312{
313 if (newstate == PLAYER_STATE_DRIVER)
314 {
315 if (GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 455)
316 {
317 new Float:x, Float:y,Float:z;
318 new query[259], DBResult: result;
319 format(query, sizeof(query), "SELECT * FROM `Shops` ORDER by Random() LIMIT 1");
320 result = db_query(Database, query);
321 SendClientMessage(playerid, ERRORCOLOR, "You are now in trucker");
322 db_get_field_assoc(result, "x", query, sizeof(query));
323 x = floatstr(query);
324 db_get_field_assoc(result, "y", query, sizeof(query));
325 y = floatstr(query);
326 db_get_field_assoc(result, "z", query, sizeof(query));
327 z = floatstr(query);
328 db_get_field_assoc(result, "owner", query, sizeof(query));
329 format(deliveringfor[playerid], 50, "%s", query);
330 SetPlayerCheckpoint(playerid, x, y, z, 7.0);
331 truckcheck[playerid] = true;
332 }
333 }
334}
335public OnPlayerEnterCheckpoint(playerid, checkpointid)
336{
337 if (truckcheck[playerid])
338 {
339 new query[128], DBResult:result;
340 new Float:xf, Float:yf,Float:zf;
341 new idf;
342 GivePlayerMoney(playerid, 5000);
343 idf = GetPlayerID(deliveringfor[playerid]);
344 if(IsPlayerConnected(idf))
345 {
346 SendClientMessage(idf, ERRORCOLOR, "You have taken 10000$ for the delivered packs!");
347 GivePlayerMoney(idf, 10000);
348 }
349 else format(query, sizeof(query),"UPDATE `User` SET `bank` = `bank` + 10000 WHERE `Name` = '%s'", deliveringfor[playerid]);
350 db_query(Database, query);
351 DisablePlayerCheckpoint(playerid);
352 truckcheck[playerid] = false;
353 format(query, sizeof(query), "SELECT * FROM `Shops` ORDER by Random() LIMIT 1");
354 result = db_query(Database, query);
355 db_get_field_assoc(result, "x", query, sizeof(query));
356 xf = floatstr(query);
357 db_get_field_assoc(result, "y", query, sizeof(query));
358 yf = floatstr(query);
359 db_get_field_assoc(result, "z", query, sizeof(query));
360 zf= floatstr(query);
361 SetPlayerCheckpoint(playerid, xf, yf, zf, 7.0);
362 truckcheck[playerid] = true;
363 db_get_field_assoc(result, "owner", query, sizeof(query));
364 format(deliveringfor[playerid], 50, "%s", query);
365 }
366 return 1;
367}
368public OnPlayerPickupDynamicPickup(playerid, pickupid)
369{
370 for (new i = 0; i < MAX_SHOPS; i++)
371 {
372 if (shopproper[i][inpickup] == pickupid)
373 {
374 SendClientMessage(playerid, ERRORCOLOR, "You are in shop Pickup !");
375 nearshop[playerid] = i;
376 SetTimerEx("removingnear", 1000, false, "i", playerid);
377 break;
378 }
379 }
380}
381forward nearshoprm(playerid);
382public nearshoprm(playerid)
383{
384 nearshop[playerid] = -1;
385 return 1;
386}
387forward removingnear(playerid);
388public removingnear(playerid)
389{
390 nearshop[playerid] = -1;
391 return 1;
392}