Advertisement
LVPYassine

Simple Phone System

Jan 20th, 2017
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.60 KB | None | 0 0
  1. /**
  2. * Copyright (c) 2015-2016 SA-MP FilterScript
  3. *
  4. * This program is free software: you can redistribute it and/or modify it under the terms of the
  5. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  6. * License, or (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  9. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. * General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with this program.
  13. * If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. /*AUTHOR ***********************
  17. @Yaa - SA-MP Scripter
  18. ********************************/
  19.  
  20. #include <a_samp>
  21. #include <a_mysql>
  22. #include <zcmd>
  23. #include <sscanf2>
  24. #include <streamer>
  25.  
  26. #define MySQL_Host ""
  27. #define MySQL_User ""
  28. #define MySQL_DB ""
  29. #define MySQL_Pass ""
  30. #define MySQL_Port 3306
  31.  
  32. #define DIALOG_PHONE 2000
  33. #define DIALOG_RECHARGE 3000
  34.  
  35. /* Config:
  36.  
  37. ISP:
  38.  
  39. id 1 = SAT
  40. id 2 = LVT
  41. id 3 = SFT
  42. */
  43.  
  44. enum PlayerSIM
  45. {
  46. Activated,
  47. ISP,
  48. SAT,
  49. LVT,
  50. SFT,
  51. Value
  52. };
  53.  
  54.  
  55. static
  56.  
  57. MySQL:register,
  58. PhoneInfo[MAX_PLAYERS][PlayerSIM],
  59. PlayerText:Net[1],
  60. CallStarted[MAX_PLAYERS],
  61. TimerPhone[MAX_PLAYERS],
  62. IsCalled[MAX_PLAYERS],
  63. Phone[5]
  64. ;
  65.  
  66. forward onCallStarted(playerid, targetid);
  67. forward onCallCostTake(playerid);
  68. forward onCallFinished(playerid, reason);
  69. forward onMySQLCheck(playerid);
  70.  
  71. #define G "{6EF83C}"
  72. #define R "{F81414}"
  73. #define W "{FFFFFF}"
  74. #define O "{FFAF00}"
  75. #define YE "{FFFF00}"
  76. #define GRI "{C0C0C0}"
  77.  
  78. public OnFilterScriptInit()
  79. {
  80. print(" -*-*-*-*-*-*-*-*-*-*-*-*-*- ");
  81. print(" * Yassine Phone System * ");
  82. print(" * Loaded * ");
  83. print(" -*-*-*-*-*-*-*-*-*-*-*-*-*- ");
  84.  
  85. Phone[0] = CreatePickup(1318, 2, -1727.5148, 1041.5735, 45.2109, -1);
  86. Phone[1] = CreatePickup(1318, 2, 2408.6062, 1987.6985, 10.8203, -1);
  87. Create3DTextLabel(""R"[Phones Dealer]", 0x008080FF, -1727.5148, 1041.5735, 45.2109, 40.0, 0, 0);
  88. Create3DTextLabel(""R"[Phones Dealer]", 0x008080FF, 2408.6062, 1987.6985, 10.8203, 40.0, 0, 0);
  89.  
  90. Phone[2] = CreateActor(165, 2318.3064, -7.4166, 26.7496, 92.5721);
  91.  
  92. Phone[3] = CreateDynamicCP(2316.6213, -7.2762, 26.7422, 1.50, -1, -1, -1, 40.0);
  93. Phone[4] = CreatePickup(1318, 2, 2305.5718, -16.1358, 26.7496, -1);
  94.  
  95. new MySQLOpt:options = mysql_init_options();
  96. mysql_set_option(options, SERVER_PORT, MySQL_Port);
  97. mysql_log(ALL);
  98. register = mysql_connect(MySQL_Host, MySQL_User, MySQL_Pass, MySQL_DB, options);
  99. if(mysql_errno() != 0)
  100. {
  101. printf("[MySQL Connection]: The connection to Database `%s` has failed.", MySQL_DB);
  102. printf("[MySQL Notice]: Fail to Create `phone` table on database `%s`", MySQL_DB);
  103. }
  104. else
  105. {
  106. printf("[MySQL Connection]: The connection to Database `%s` was successful.", MySQL_DB);
  107. mysql_query(register, "CREATE TABLE IF NOT EXISTS `phone` (`Name` VARCHAR(64),`ISP` INT(129), `Value` INT(20))");
  108. }
  109. return 1;
  110. }
  111.  
  112. public OnFilterScriptExit()
  113. {
  114. print(" -*-*-*-*-*-*-*-*-*-*-*-*-*- ");
  115. print(" * Yassine Phone System * ");
  116. print(" * UnLoaded * ");
  117. print(" -*-*-*-*-*-*-*-*-*-*-*-*-*- ");
  118.  
  119. DestroyPickup(Phone[0]);
  120. DestroyPickup(Phone[1]);
  121. DestroyActor(Phone[2]);
  122. mysql_close(register);
  123. return 1;
  124. }
  125.  
  126. public OnPlayerConnect(playerid)
  127. {
  128.  
  129. Net[0] = CreatePlayerTextDraw(playerid,69.000000, 317.000000, "SAT");
  130. PlayerTextDrawBackgroundColor(playerid,Net[0], 255);
  131. PlayerTextDrawFont(playerid,Net[0], 1);
  132. PlayerTextDrawLetterSize(playerid,Net[0], 0.500000, 1.000000);
  133. PlayerTextDrawColor(playerid,Net[0], -1);
  134. PlayerTextDrawSetOutline(playerid,Net[0], 0);
  135. PlayerTextDrawSetProportional(playerid,Net[0], 1);
  136. PlayerTextDrawSetShadow(playerid,Net[0], 1);
  137. PlayerTextDrawSetSelectable(playerid,Net[0], 0);
  138.  
  139. new queryS[128];
  140. mysql_format(register, queryS, sizeof(queryS), "SELECT * FROM `phone` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
  141. mysql_tquery(register, queryS, "onMySQLCheck", "i", playerid);
  142. return 1;
  143. }
  144. public OnPlayerSpawn(playerid)
  145. {
  146. if(PhoneInfo[playerid][ISP] == 3)
  147. {
  148. PlayerTextDrawSetString(playerid, Net[0], "SFT");
  149. }
  150. if(PhoneInfo[playerid][ISP] == 2)
  151. {
  152. PlayerTextDrawSetString(playerid, Net[0], "LVT");
  153. }
  154. if(PhoneInfo[playerid][ISP] == 1)
  155. {
  156. PlayerTextDrawSetString(playerid, Net[0], "SAT");
  157. }
  158. PlayerTextDrawShow(playerid, Net[0]);
  159.  
  160. if(PhoneInfo[playerid][Activated] == 0)
  161. {
  162. PlayerTextDrawHide(playerid, Net[0]);
  163. }
  164. return 1;
  165. }
  166. public OnPlayerDisconnect(playerid, reason)
  167. {
  168. if(PhoneInfo[playerid][Activated] == 1)
  169. {
  170. new querylist[200];
  171. format(querylist, sizeof(querylist), "UPDATE `phone` SET `ISP` = '%d', `Value` = '%d'", PhoneInfo[playerid][ISP], PhoneInfo[playerid][Value]);
  172. mysql_query(register, querylist);
  173. }
  174. return 1;
  175. }
  176.  
  177. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  178. {
  179. if(dialogid == DIALOG_PHONE)
  180. {
  181. switch(listitem)
  182. {
  183. case 0:
  184. {
  185. ShowPlayerDialog(playerid, DIALOG_RECHARGE, DIALOG_STYLE_INPUT, "Recharging your account", "Please enter a value below for recharge your account", "Buy", "Cancel");
  186. }
  187. case 1:
  188. {
  189. ShowPlayerDialog(playerid, DIALOG_PHONE+1, DIALOG_STYLE_LIST, "SIM Cards", ""W"Las Venturas Telecom\nSan Fierro Telecom\n"R"[HOT!]"W"San Andreas Telecom", "Buy", "Cancel");
  190. }
  191. }
  192. }
  193. if(dialogid == DIALOG_RECHARGE)
  194. {
  195. if(response)
  196. {
  197. if(strval(inputtext) == 0) return SendClientMessage(playerid, -1, ""R"Error: You can't recharge 0 $ :/ ");
  198. if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, ""R"Error: you don't have all this money ");
  199. GivePlayerMoney(playerid, -strval(inputtext));
  200. PhoneInfo[playerid][Value] = PhoneInfo[playerid][Value] + strval(inputtext);
  201. SendClientMessage(playerid, -1, ""G"Success: You account recharged !");
  202. }
  203. }
  204. if(dialogid == DIALOG_PHONE+1)
  205. {
  206. switch(listitem)
  207. {
  208. case 0:
  209. {
  210. ShowPlayerDialog(playerid, DIALOG_PHONE+2, DIALOG_STYLE_MSGBOX, "Las Venturas Telecom", "Welcome to LVT ! \nWe will give you the following functions: \n- Call Cost $ 70/sec\n- Cheap Price\n Price: $ 10\n Do you really want to buy from us a SIM Card?", "Buy", "Cancel");
  211. }
  212. case 1:
  213. {
  214. ShowPlayerDialog(playerid, DIALOG_PHONE+3, DIALOG_STYLE_MSGBOX, "San Fierro Telecom", "Welcome to SFT ! \nWe will give you the following functions: \n- Call Cost $ 50/sec \n- Cheap Price\n Price: $ 1000 \n Do you really want to buy from us a SIM Card?", "Buy", "Cancel");
  215. }
  216. case 2:
  217. {
  218. ShowPlayerDialog(playerid, DIALOG_PHONE+4, DIALOG_STYLE_MSGBOX, "San Andreas Telecom", "Welcome to SAT ! \nWe will give you the following functions: \n- Call Cost $ 10/sec\n- recharge $ 1000\n- Free first 50 seconds !\n Price: $ 10 000\n Do you really want to buy from us a SIM Card?", "Buy", "Cancel");
  219. }
  220. }
  221. }
  222. if(dialogid == DIALOG_PHONE+2)
  223. {
  224. if(response)
  225. {
  226. new str[200];
  227. if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, -1, ""R"Error: you dont have $ 10 in the hand !");
  228. GivePlayerMoney(playerid, -100);
  229. PhoneInfo[playerid][LVT] = 1;
  230. PhoneInfo[playerid][ISP] = 2;
  231. PhoneInfo[playerid][Activated] = 1;
  232. SendClientMessage(playerid, -1, ""G"[LVT]: Now you are able to use /call !");
  233. format(str, sizeof(str), "INSERT INTO `phone`(`Name`, `ISP`, `Value`) VALUES ('%s', 2, 100)", GetName(playerid));
  234. mysql_query(register, str);
  235. }
  236. }
  237. if(dialogid == DIALOG_PHONE+3)
  238. {
  239. if(response)
  240. {
  241. new str[200];
  242. if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, ""R"Error: you dont have $ 1000 in the hand !");
  243. GivePlayerMoney(playerid, -100);
  244. PhoneInfo[playerid][SFT] = 1;
  245. PhoneInfo[playerid][ISP] = 3;
  246. PhoneInfo[playerid][Activated] = 1;
  247. SendClientMessage(playerid, -1, ""G"[SFT]: Now you are able to use /call !");
  248. format(str, sizeof(str), "INSERT INTO `phone`(`Name`, `ISP`, `Value`) VALUES ('%s', 3, 100)", GetName(playerid));
  249. mysql_query(register, str);
  250. }
  251. }
  252. if(dialogid == DIALOG_PHONE+4)
  253. {
  254. if(response)
  255. {
  256. new str[200];
  257. if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, ""R"Error: you dont have $ 10000 in the hand !");
  258. GivePlayerMoney(playerid, -100);
  259. PhoneInfo[playerid][SAT] = 1;
  260. PhoneInfo[playerid][ISP] = 1;
  261. PhoneInfo[playerid][Activated] = 1;
  262. PhoneInfo[playerid][Value] = 500;
  263. SendClientMessage(playerid, -1, ""G"[SAT]: Now you are able to use /call !");
  264. format(str, sizeof(str), "INSERT INTO `phone`(`Name`, `ISP`, `Value`) VALUES ('%s', 1, 600)", GetName(playerid));
  265. mysql_query(register, str);
  266. PlayerTextDrawShow(playerid, Net[0]);
  267. }
  268. }
  269. return 1;
  270. }
  271. public OnPlayerText(playerid, text[])
  272. {
  273. if(CallStarted[playerid] == 1)
  274. {
  275. new str[100];
  276. format(str, sizeof(str), ""GRI"["G"Phone"GRI" %s]: "W"%s", GetName(playerid), text);
  277. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, str);
  278. SendClientMessage(playerid, -1, str);
  279. return 0;
  280. }
  281. return 0;
  282. }
  283.  
  284. public OnPlayerPickUpPickup(playerid, pickupid)
  285. {
  286. if(Phone[0] == pickupid || Phone[1] == pickupid)
  287. {
  288. SetPlayerPos(playerid, 2315.952880,-1.618174,26.742187);
  289. }
  290. if(Phone[4] == pickupid)
  291. {
  292. SetPlayerPos(playerid, 2412.8931, 1987.4094, 10.8203);
  293. }
  294. return 1;
  295. }
  296.  
  297. public onMySQLCheck(playerid)
  298. {
  299. new rows;
  300. cache_get_row_count(rows);
  301. if(rows == 1)
  302. {
  303. cache_get_value_name_int(0, "ISP", PhoneInfo[playerid][ISP]);
  304. cache_get_value_name_int(0, "Value", PhoneInfo[playerid][Value]);
  305.  
  306. PhoneInfo[playerid][Activated] = 1;
  307. if(PhoneInfo[playerid][ISP] == 1)
  308. {
  309. PhoneInfo[playerid][SAT] = 1;
  310. }
  311. if(PhoneInfo[playerid][ISP] == 2)
  312. {
  313. PhoneInfo[playerid][LVT] = 1;
  314. }
  315. if(PhoneInfo[playerid][ISP] == 3)
  316. {
  317. PhoneInfo[playerid][SFT] = 1;
  318. }
  319. }
  320. else
  321. {
  322. PhoneInfo[playerid][Activated] = 0;
  323. }
  324. return 1;
  325. }
  326.  
  327. CMD:call(playerid, params[])
  328. {
  329. if(CallStarted[playerid] == 1)
  330. {
  331. onCallFinished(playerid, 0);
  332. }
  333. else
  334. {
  335. new id, str[150];
  336. if(PhoneInfo[playerid][Activated] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please buy a SIM card Before trying to call someone !");
  337. if(PhoneInfo[playerid][Value] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please recharge your account before speak with anyone !");
  338. if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, ""R"Usage: /call [playerid]");
  339. if(playerid == id) return SendClientMessage(playerid, -1, ""R"You can't call youself, Silly !");
  340. if(PhoneInfo[id][Activated] == 0)
  341. {
  342. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Started...");
  343. format(str, sizeof(str), ""GRI"["G"%s"GRI"]: "W"Sorry, this player number not exists or not activated", PhoneInfo[playerid][ISP]);
  344. SendClientMessage(playerid, -1 ,str);
  345. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  346. return 1;
  347. }
  348. else
  349. {
  350. new isp[20];
  351. if(PhoneInfo[playerid][ISP] == 1) isp = "SAT";
  352. if(PhoneInfo[playerid][ISP] == 2) isp = "LVT";
  353. if(PhoneInfo[playerid][ISP] == 3) isp = "SFT";
  354.  
  355. SetPVarInt(playerid, "CalledPlayer", id);
  356. SetPVarInt(id, "CalledPlayer", playerid);
  357. IsCalled[id] = 1;
  358. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Start Calling...");
  359. SendClientMessage(id, -1, ""GRI"["G"Phone"GRI"]: "W"New Call");
  360. format(str, sizeof(str), ""GRI"["G"%s"GRI"]: "W"You have a new call from %s use "GRI"/answer "W"to accept call else use "GRI"/decline", isp, GetName(playerid));
  361. SendClientMessage(id, -1 ,str);
  362. }
  363. }
  364. return 1;
  365. }
  366.  
  367. CMD:answer(playerid, params[])
  368. {
  369. if(PhoneInfo[playerid][Activated] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please buy a SIM card Before trying to call someone !");
  370. if(PhoneInfo[playerid][Value] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please recharge your account before speak with anyone !");
  371. if(IsCalled[playerid] == 0) return SendClientMessage(playerid, -1, ""R"Error: you have no new calls !");
  372. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"Connection Success ! Start speak !");
  373. onCallStarted(playerid, GetPVarInt(playerid, "CalledPlayer"));
  374. return 1;
  375. }
  376.  
  377. CMD:decline(playerid, params[])
  378. {
  379. if(PhoneInfo[playerid][Activated] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please buy a SIM card Before trying to call someone !");
  380. if(PhoneInfo[playerid][Value] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please recharge your account before speak with anyone !");
  381. if(IsCalled[playerid] == 0) return SendClientMessage(playerid, -1, ""R"Error: you have no new calls !");
  382. IsCalled[playerid] = 0;
  383. onCallFinished(playerid, 2);
  384. return 1;
  385. }
  386.  
  387. CMD:phone(playerid, params[])
  388. {
  389. if(PhoneInfo[playerid][Activated] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please buy a SIM card Before trying to call someone !");
  390. if(PhoneInfo[playerid][Value] == 0) return SendClientMessage(playerid, -1, ""R"Error: Please recharge your account before speak with anyone !");
  391. new str[120];
  392.  
  393. format(str, sizeof(str), ""GRI"["G"Phone"GRI"]: "W"You are using ISP Id:%d ", PhoneInfo[playerid][ISP]);
  394. SendClientMessage(playerid, -1, str);
  395. SendClientMessage(playerid, -1, "ISP Ids: SAT -> 1, LVT -> 2, SFT -> 3");
  396. format(str, sizeof(str), ""GRI"["G"Phone"GRI"]: "W"You have $ %d in your account", PhoneInfo[playerid][Value]);
  397. SendClientMessage(playerid, -1, str);
  398. return 1;
  399. }
  400.  
  401. public onCallStarted(playerid, targetid)
  402. {
  403. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  404. SetPlayerSpecialAction(targetid, SPECIAL_ACTION_USECELLPHONE);
  405.  
  406. SetPVarInt(playerid, "CalledPlayer", targetid);
  407. SetPVarInt(targetid, "CalledPlayer", playerid);
  408.  
  409. CallStarted[playerid] = 1;
  410. CallStarted[targetid] = 1;
  411.  
  412. TimerPhone[playerid] = SetTimerEx("onCallCostTake", 1000, true, "i", playerid);
  413. TimerPhone[targetid] = SetTimerEx("onCallCostTake", 1000, true, "i", targetid);
  414.  
  415. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Started...");
  416. return 1;
  417. }
  418.  
  419. public onCallFinished(playerid, reason)
  420. {
  421. if(reason == 1)
  422. {
  423. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"You have no more money to pay the phone calls !");
  424. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  425.  
  426. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"Lost Connection.");
  427. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  428.  
  429. CallStarted[GetPVarInt(playerid, "CalledPlayer")] = 0;
  430. CallStarted[playerid] = 0;
  431.  
  432. KillTimer(TimerPhone[playerid]);
  433. KillTimer(TimerPhone[GetPVarInt(playerid, "CalledPlayer")]);
  434.  
  435. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  436. SetPlayerSpecialAction(GetPVarInt(playerid, "CalledPlayer"), SPECIAL_ACTION_STOPUSECELLPHONE);
  437. return 1;
  438. }
  439. if(reason == 2)
  440. {
  441. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  442.  
  443. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"this number busy at moment.");
  444. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  445.  
  446. CallStarted[GetPVarInt(playerid, "CalledPlayer")] = 0;
  447. CallStarted[playerid] = 0;
  448.  
  449. KillTimer(TimerPhone[playerid]);
  450. KillTimer(TimerPhone[GetPVarInt(playerid, "CalledPlayer")]);
  451.  
  452. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  453. SetPlayerSpecialAction(GetPVarInt(playerid, "CalledPlayer"), SPECIAL_ACTION_STOPUSECELLPHONE);
  454. return 1;
  455. }
  456. else
  457. {
  458. SendClientMessage(playerid, -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  459. CallStarted[playerid] = 0;
  460. SendClientMessage(GetPVarInt(playerid, "CalledPlayer"), -1, ""GRI"["G"Phone"GRI"]: "W"Call Ended.");
  461. CallStarted[GetPVarInt(playerid, "CalledPlayer")] = 0;
  462. KillTimer(TimerPhone[playerid]);
  463. KillTimer(TimerPhone[GetPVarInt(playerid, "CalledPlayer")]);
  464. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  465. SetPlayerSpecialAction(GetPVarInt(playerid, "CalledPlayer"), SPECIAL_ACTION_STOPUSECELLPHONE);
  466. }
  467. return 1;
  468. }
  469.  
  470. public onCallCostTake(playerid)
  471. {
  472. if(PhoneInfo[playerid][Value] == 0) return onCallFinished(playerid, 1);
  473. if(PhoneInfo[playerid][SFT] == 1) PhoneInfo[playerid][Value] = PhoneInfo[playerid][Value] - 50;
  474. if(PhoneInfo[playerid][LVT] == 1) PhoneInfo[playerid][Value] = PhoneInfo[playerid][Value] - 70;
  475. if(PhoneInfo[playerid][SAT] == 1) PhoneInfo[playerid][Value] = PhoneInfo[playerid][Value] - 10;
  476. return 1;
  477. }
  478.  
  479. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  480. {
  481. if(checkpointid == Phone[3])
  482. {
  483. ShowPlayerDialog(playerid, DIALOG_PHONE, DIALOG_STYLE_LIST, "Phone Dealer", ""W"Recharging my account\nBuy a SIM Card", "Buy", "Cancel");
  484. }
  485. return 1;
  486. }
  487.  
  488. stock GetName(playerid)
  489. {
  490. new szName[MAX_PLAYER_NAME];
  491. GetPlayerName(playerid, szName, sizeof(szName));
  492. return szName;
  493. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement