Advertisement
Guest User

...

a guest
Feb 28th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.41 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <a_mysql>
  4. #include <sscanf2>
  5. #include <colors>
  6.  
  7. new RandomMSG[][] =
  8. {
  9. "{FF0000}[BOT]S.A.M.:{FFFFFF}Please visit our forums to read the latest news!",
  10. "{FF0000}[BOT]S.A.M.:{FFFFFF}Did you know, the owners are Brad & illuminati?",
  11. "{FF0000}[BOT]S.A.M.:{FFFFFF}Please report if you have any questions",
  12. "{FF0000}[BOT]S.A.M.:{FFFFFF}Please visit our forums to read the latest news!"
  13. };
  14.  
  15.  
  16. native WP_Hash(_buffer[], len, const str[]);
  17.  
  18. #define DIALOG_REGISTER 1
  19. #define DIALOG_LOGIN 2
  20.  
  21. #define MySQL_Host ""
  22. #define MySQL_Username "server_739"
  23. #define MySQL_Password ""
  24. #define MySQL_Database "server_739"
  25.  
  26. enum pInfo
  27. {
  28. pScore,
  29. pAdmin,
  30. pVip,
  31. pTrusted,
  32. pHighest,
  33. pMoney,
  34. pKills,
  35. pDeaths
  36. }
  37. new PlayerInfo[MAX_PLAYERS][pInfo];
  38.  
  39. new connection;
  40. new MySQL_Query[1800];
  41.  
  42. new PasswordAttempts[MAX_PLAYERS];
  43. new IsPlayerLoggedIn[MAX_PLAYERS char];
  44.  
  45. forward LoggedIn(playerid, const password[]);
  46. forward CheckPasswordAttempts(playerid);
  47. forward IsRegistered(playerid);
  48.  
  49. //==============================================================================
  50.  
  51. main()
  52. {
  53. print("\n----------------------------------");
  54. print(" Blank Gamemode by your name here");
  55. print("----------------------------------\n");
  56. }
  57. public OnGameModeInit()
  58. {
  59. SetTimer("SendMSG", 60000, true);
  60. connection = mysql_connect(MySQL_Host, MySQL_Username, MySQL_Database, MySQL_Password);
  61. if(!mysql_errno(connection)) print("MySQL Connection Success");
  62. else print("MySQL Connection Failed");
  63.  
  64. SetGameModeText("Blank Script");
  65. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  66. return 1;
  67. }
  68. forward SendMSG();
  69.  
  70. public SendMSG()
  71. {
  72. new randMSG = random(sizeof(RandomMSG));
  73. SendClientMessageToAll(-1, RandomMSG[randMSG]); // Replace the "COLOR" with your defined color.
  74. }
  75.  
  76. public OnGameModeExit()
  77. {
  78. mysql_close(connection);
  79. return 1;
  80. }
  81.  
  82. public OnPlayerRequestClass(playerid, classid)
  83. {
  84. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  85. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  86. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  87. return 1;
  88. }
  89.  
  90. public OnPlayerConnect(playerid)
  91. {
  92. format(MySQL_Query, sizeof(MySQL_Query), "SELECT * FROM `Accounts` WHERE Username = '%s'", EscapeText(PlayerName(playerid)));
  93. mysql_function_query(connection, MySQL_Query, true, "IsRegistered", "i", playerid);
  94. return 1;
  95. }
  96.  
  97. public OnPlayerDisconnect(playerid, reason)
  98. {
  99. if(IsPlayerLoggedIn{playerid} == 1)
  100. {
  101. format(MySQL_Query, sizeof(MySQL_Query), "UPDATE `Accounts` SET Score = '%i' , Admin = '%i' , Vip = '%i' , Trusted_Players = '%i' , Highest_Donator = '%i' , Money = '%i', Kills = '%i', Deaths = '%i' WHERE Username = '%s'",
  102. PlayerInfo[playerid][pScore], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVip], PlayerInfo[playerid][pTrusted], PlayerInfo[playerid][pHighest], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], EscapeText(PlayerName(playerid)));
  103. mysql_function_query(connection, MySQL_Query, false, "", "");
  104. }
  105.  
  106. PlayerInfo[playerid][pAdmin] = 0;
  107. PlayerInfo[playerid][pVip] = 0;
  108. PlayerInfo[playerid][pScore] = 0;
  109. PlayerInfo[playerid][pTrusted] = 0;
  110. PlayerInfo[playerid][pHighest] = 0;
  111. PlayerInfo[playerid][pMoney] = 0;
  112. return 1;
  113. }
  114.  
  115. public OnPlayerSpawn(playerid)
  116. {
  117. return 1;
  118. }
  119.  
  120. public OnPlayerDeath(playerid, killerid, reason)
  121. {
  122. if(killerid != INVALID_PLAYER_ID) return 1;
  123.  
  124. PlayerInfo[playerid][pDeaths] += 1;
  125. PlayerInfo[killerid][pKills] += 1;
  126. return 1;
  127. }
  128.  
  129. public OnVehicleSpawn(vehicleid)
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnVehicleDeath(vehicleid, killerid)
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnPlayerText(playerid, text[])
  140. {
  141. return 1;
  142. }
  143.  
  144. /*public OnPlayerCommandText(playerid, cmdtext[])
  145. {
  146. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  147. {
  148. // Do something here
  149. return 1;
  150. }
  151. return 0;
  152. }*/
  153.  
  154. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerExitVehicle(playerid, vehicleid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerStateChange(playerid, newstate, oldstate)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerEnterCheckpoint(playerid)
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnPlayerLeaveCheckpoint(playerid)
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnPlayerEnterRaceCheckpoint(playerid)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnPlayerLeaveRaceCheckpoint(playerid)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnRconCommand(cmd[])
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerRequestSpawn(playerid)
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnObjectMoved(objectid)
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnPlayerObjectMoved(playerid, objectid)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnPlayerPickUpPickup(playerid, pickupid)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnVehicleMod(playerid, vehicleid, componentid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerSelectedMenuRow(playerid, row)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnPlayerExitedMenu(playerid)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnRconLoginAttempt(ip[], password[], success)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnPlayerUpdate(playerid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnPlayerStreamIn(playerid, forplayerid)
  260. {
  261. return 1;
  262. }
  263.  
  264. public OnPlayerStreamOut(playerid, forplayerid)
  265. {
  266. return 1;
  267. }
  268.  
  269. public OnVehicleStreamIn(vehicleid, forplayerid)
  270. {
  271. return 1;
  272. }
  273.  
  274. public OnVehicleStreamOut(vehicleid, forplayerid)
  275. {
  276. return 1;
  277. }
  278.  
  279. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  280. {
  281. if(dialogid == DIALOG_REGISTER)
  282. {
  283. if(!response)
  284. {
  285. Kick(playerid);
  286. return 1;
  287. }
  288.  
  289. if(!strlen(inputtext))
  290. {
  291. SendClientMessage(playerid, -1, "Enter a password.");
  292. ShowRegisterScreen(playerid);
  293. return 1;
  294. }
  295.  
  296. if(strlen(inputtext) < 5)
  297. {
  298. SendClientMessage(playerid, -1, "Enter a password with more than 5 characters.");
  299. ShowRegisterScreen(playerid);
  300. return 1;
  301. }
  302.  
  303. if(strlen(inputtext) >= 5)
  304. {
  305. new IP[20], hashedpass[200];
  306. GetPlayerIp(playerid, IP, sizeof(IP));
  307. WP_Hash(hashedpass, sizeof(hashedpass), inputtext);
  308.  
  309. new querystring[1800];
  310.  
  311. strcat(querystring, "INSERT INTO `Accounts` (`ID`, `Username`, `Password`, `Admin`, `Vip, `Money`, `Kills`, `Deaths`, `Trusted_Player`, `Highest_Donator`)");
  312. strcat(querystring, " VALUES");
  313.  
  314. format(MySQL_Query, sizeof(MySQL_Query), "%s (NULL, '%s', '%s', '0', '0', '0', '0', '0', '0', '0')", querystring, EscapeText(PlayerName(playerid)), EscapeText(hashedpass));
  315. mysql_function_query(connection, MySQL_Query, false, "", "");
  316. }
  317. IsPlayerLoggedIn{playerid} = 1;
  318. return 1;
  319. }
  320.  
  321. if(dialogid == DIALOG_LOGIN)
  322. {
  323. if(!response)
  324. {
  325. Kick(playerid);
  326. return 1;
  327. }
  328.  
  329. if(!strlen(inputtext))
  330. {
  331. SendClientMessage(playerid, -1, "Enter a password.");
  332. ShowLoginScreen(playerid);
  333. }
  334.  
  335. if(strlen(inputtext) < 5)
  336. {
  337. SendClientMessage(playerid, -1, "Enter a password with more than 5 char.");
  338. ShowLoginScreen(playerid);
  339. }
  340.  
  341. if(strlen(inputtext) >= 5)
  342. {
  343. format(MySQL_Query, sizeof(MySQL_Query), "SELECT * FROM `Accounts` WHERE Username='%s'", EscapeText(PlayerName(playerid)));
  344. mysql_function_query(connection, MySQL_Query, true, "LoggedIn", "is", playerid, inputtext);
  345. }
  346. return 1;
  347. }
  348. return 1;
  349. }
  350.  
  351. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  352. {
  353. return 1;
  354. }
  355.  
  356. public LoggedIn(playerid, const password[])
  357. {
  358. new ppassword[500];
  359. new hashedpass[500];
  360.  
  361. WP_Hash(hashedpass, sizeof(hashedpass), password);
  362. cache_get_field_content(0, "Password", ppassword, connection);
  363.  
  364. if(!strcmp(hashedpass, ppassword))
  365. {
  366. if(IsPlayerLoggedIn{playerid} != 1)
  367. {
  368. new tempfetch[500];
  369. cache_get_field_content(0, "Score", tempfetch, connection), PlayerInfo[playerid][pScore] = strval(tempfetch);
  370. cache_get_field_content(0, "Admin", tempfetch, connection), PlayerInfo[playerid][pAdmin] = strval(tempfetch);
  371. cache_get_field_content(0, "Vip", tempfetch, connection), PlayerInfo[playerid][pVip] = strval(tempfetch);
  372. cache_get_field_content(0, "Trusted_Player", tempfetch, connection), PlayerInfo[playerid][pTrusted] = strval(tempfetch);
  373. cache_get_field_content(0, "Highest_Donator", tempfetch, connection), PlayerInfo[playerid][pHighest] = strval(tempfetch);
  374. cache_get_field_content(0, "Money", tempfetch, connection), PlayerInfo[playerid][pMoney] = strval(tempfetch);
  375. cache_get_field_content(0, "Kills", tempfetch, connection), PlayerInfo[playerid][pKills] = strval(tempfetch);
  376. cache_get_field_content(0, "Deaths", tempfetch, connection), PlayerInfo[playerid][pDeaths] = strval(tempfetch);
  377.  
  378. IsPlayerLoggedIn{playerid} = 1;
  379.  
  380. SendClientMessage(playerid, -1, "{8EC7DC}[INFO] {FFFFFF}Your statistics have been restored.");
  381. return 1;
  382. }
  383. }
  384. else
  385. {
  386. CheckPasswordAttempts(playerid);
  387. ShowLoginScreen(playerid);
  388. }
  389. return 1;
  390. }
  391.  
  392. public CheckPasswordAttempts(playerid)
  393. {
  394. if(PasswordAttempts[playerid] == 0)
  395. {
  396. SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You have entered an incorrect password. [1/3]");
  397. PasswordAttempts[playerid] ++;
  398. return 1;
  399. }
  400.  
  401. if(PasswordAttempts[playerid] == 1)
  402. {
  403. SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You have entered an incorrect password. [2/3]");
  404. PasswordAttempts[playerid] ++;
  405. return 1;
  406. }
  407.  
  408. if(PasswordAttempts[playerid] == 2)
  409. {
  410. new string[128];
  411. SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You have entered an incorrect password. [3/3]");
  412.  
  413. format(string,sizeof(string),"{208DD6}[SERVER] {FFFFFF}%s[%d] has been kicked from the server. (Max password attempts)",PlayerName(playerid),playerid);
  414. SendClientMessageToAll(COLOR_WHITE,string);
  415.  
  416. Kick(playerid);
  417. return 1;
  418. }
  419. return 1;
  420. }
  421.  
  422. public IsRegistered(playerid)
  423. {
  424. new rows, fields;
  425.  
  426. cache_get_data(rows, fields, connection);
  427.  
  428. if(rows)
  429. {
  430. ShowLoginScreen(playerid);
  431. }
  432. else
  433. {
  434. ShowRegisterScreen(playerid);
  435. }
  436. return 1;
  437. }
  438.  
  439. public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
  440. {
  441. printf("Error ID: %i", errorid);
  442. printf("Error: %s", error);
  443. printf("callback: %s", callback);
  444. printf("query: %s", query);
  445. return 1;
  446. }
  447.  
  448. stock EscapeText(text[])
  449. {
  450. new EscapedData[200];
  451. mysql_real_escape_string(text, EscapedData, connection);
  452. return EscapedData;
  453. }
  454.  
  455. stock ShowLoginScreen(playerid)
  456. {
  457. new string[128];
  458. format(string, sizeof(string), "Before playing you must login\n\nUsername: %s\n\nEnter your password below and click login",PlayerName(playerid));
  459. ShowPlayerDialog(playerid,DIALOG_LOGIN,3,"{EDDC57}Login required",string,"Login","Cancel");
  460. }
  461.  
  462. stock ShowRegisterScreen(playerid)
  463. {
  464. new string[128];
  465. format(string, sizeof(string), "This server requires you to register an account before playing\n\nUsername: %s\n\nEnter your desired password below then click ok",PlayerName(playerid));
  466. ShowPlayerDialog(playerid,DIALOG_REGISTER,3,"{EDDC57}Registration required",string,"Register","Cancel");
  467. }
  468.  
  469. stock PlayerName(playerid)
  470. {
  471. new name[21];
  472. GetPlayerName(playerid, name, sizeof(name));
  473. return name;
  474. }
  475.  
  476.  
  477. CMD:setlevel(playerid,params[])
  478. {
  479. new string[128], ID, level;
  480.  
  481. if(PlayerInfo[playerid][pAdmin] < 3) // change this to owner level
  482. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You don't have access to this command.");
  483.  
  484. if(sscanf(params,"ii",ID,level))
  485. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}USAGE: /setlevel [playerid] [Level]");
  486.  
  487. if(!IsPlayerConnected(ID))
  488. return SendClientMessage(playerid, COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}The requested playerid is not connected to the server.");
  489.  
  490. if(PlayerInfo[playerid][pAdmin] <= PlayerInfo[ID][pAdmin])
  491. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF} This has no effect on the current playerid.");
  492.  
  493. if(PlayerInfo[ID][pAdmin] == level)
  494. {
  495. format(string,sizeof(string),"{B30000}[ERROR] {FFFFFF}%s[%d] is already at the Administrator level: %d",PlayerName(ID),ID,level);
  496. SendClientMessage(playerid,COLOR_WHITE,string);
  497. return 1;
  498. }
  499.  
  500. if(playerid == ID)
  501. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You cannot set your own Administrator level.");
  502.  
  503. if(PlayerInfo[ID][pAdmin] < level)
  504. {
  505. format(string, sizeof(string), "{46A4E3}[ADMIN] {FFFFFF}%s[%d] has promoted %s[%d] to level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,level);
  506. SendClientMessageToAll(COLOR_WHITE,string);
  507. }
  508.  
  509. else if(PlayerInfo[ID][pAdmin] > level)
  510. {
  511. format(string, sizeof(string), "{46A4E3}[ADMIN] {FFFFFF}%s[%d] has demoted %s[%d] to level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,level);
  512. SendClientMessageToAll(COLOR_WHITE,string);
  513. }
  514.  
  515. PlayerInfo[ID][pAdmin] = level;
  516.  
  517. return 1;
  518. }
  519.  
  520. CMD:setscore(playerid,params[])
  521. {
  522. new string[128], ID, score;
  523.  
  524. if(PlayerInfo[playerid][pAdmin] < 3) // change to owner rank
  525. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}You don't have access to this command.");
  526.  
  527. if(sscanf(params,"ii",ID,score))
  528. return SendClientMessage(playerid, COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}The requested playerid is not connected to the server.");
  529.  
  530. if(!IsPlayerConnected(ID))
  531. return SendClientMessage(playerid, COLOR_WHITE,"{B30000}[ERROR] {FFFFFF}The requested playerid is not connected to the server.");
  532.  
  533. if(PlayerInfo[playerid][pAdmin] < PlayerInfo[ID][pAdmin])
  534. return SendClientMessage(playerid,COLOR_WHITE,"{B30000}[ERROR] {FFFFFF} This has no effect on the current playerid.");
  535.  
  536. format(string,sizeof(string),"{46A4E3}[ADMIN] {FFFFFF}%s[%d] has set %s[%d]'s score to %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,score);
  537. SendClientMessageToAll(COLOR_WHITE,string);
  538.  
  539. SetPlayerScore(ID, score);
  540. PlayerInfo[ID][pScore] = score;
  541. return 1;
  542. }
  543.  
  544. CMD:kick(playerid, params[])
  545. {
  546. new id, sendername[MAX_PLAYER_NAME], string[128], reason[128];
  547. if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, -1," you are not authorized to use this command");
  548. if(sscanf(params,"us[128]",id, reason)) return SendClientMessage(playerid, -1,"USAGE: /kick [playerid/partofname] [reason]");
  549. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"Player is not connected");
  550. else
  551. {
  552. GetPlayerName(playerid, sendername, sizeof(sendername));
  553. format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", id, sendername, reason);
  554. SendClientMessageToAll(0xF00505FF ,string);
  555. Kick(id);
  556. }
  557. return 1;
  558. }
  559.  
  560. CMD:ban(playerid, params[])
  561. {
  562. new id, sendername[MAX_PLAYER_NAME], string[128], reason[128];
  563. if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, -1," you are not authorized to use this command");
  564. if(sscanf(params,"us[128]",id, reason)) return SendClientMessage(playerid, -1,"USAGE: /ban [playerid/partofname] [reason]");
  565. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"Player is not connected");
  566. else
  567. {
  568. GetPlayerName(playerid, sendername, sizeof(sendername));
  569. format(string, sizeof(string), "AdmCmd: %s was BANNED! by %s, reason: %s", id, sendername, reason);
  570. SendClientMessageToAll(0xF00505FF ,string);
  571. Ban(id);
  572. }
  573. return 1;
  574. }
  575.  
  576. CMD:forcekill(playerid, params[]) //using ZCMD this is how your command will start off looking like.
  577. {
  578. new otherplayerid;
  579. if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1," you are not authorized to use this command");
  580. if(sscanf(params, "u", otherplayerid)) return SendClientMessage(playerid, COLOR_RED, "Use /forcekill [playerid/name]");
  581. else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
  582. else
  583. {
  584.  
  585. SendClientMessage(otherplayerid,COLOR_RED,"You have been killed by an Administrator");
  586. SetPlayerHealth(otherplayerid,0);
  587. }
  588. return 1;
  589. }
  590.  
  591. CMD:pay(playerid,params[])
  592. {
  593. new
  594. ID,
  595. amount,
  596. name[MAX_PLAYERS],
  597. string7[200],
  598. name2[MAX_PLAYERS],
  599. string8[200];
  600. if(sscanf(params, "ui", ID,amount)) return SendClientMessage(playerid, -1, "Usage: /pay [playerid] [amount]");
  601. if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: You do not have enough money to pay that player!");
  602. if(amount <= 0) return SendClientMessage(playerid, -1, "[ERROR]: You cannot pay less than $1!");
  603. if(playerid == ID) return SendClientMessage(playerid, -1, "[ERROR]: You can't pay yourself!");
  604. GetPlayerName(ID, name2, sizeof(name2));
  605. format(string8, sizeof(string8),"You have paid %s $%i", name2, amount);
  606. SendClientMessage(playerid, COLOR_RED, string8);
  607. GetPlayerName(playerid, name, sizeof(name));
  608. format(string7, sizeof(string7), "%s(%d) Has paid you: $%i", name, playerid, amount);
  609. SendClientMessage(ID, COLOR_RED, string7);
  610. GivePlayerMoney(ID, amount);
  611. GivePlayerMoney(playerid, -amount);
  612. return 1;
  613. }
  614.  
  615. CMD:fixveh(playerid,params[])
  616. {
  617. if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1," you are not authorized to use this command");
  618. RepairVehicle(GetPlayerVehicleID(playerid));
  619. SendClientMessage(playerid, -1, "Vehicle Repaired");
  620. return 1;
  621. }
  622.  
  623. CMD:givecash(playerid, params[])
  624. {
  625. new pID, cash;
  626. if(PlayerInfo[playerid][pAdmin] >= 6)
  627. {
  628. if(sscanf(params, "ud", pID, cash)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /givecash [playerid] [amount of money]");
  629. if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
  630. ResetPlayerMoney(pID);
  631. return GivePlayerMoney(pID,cash);
  632. }
  633. else if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1," you are not authorized to use this command");
  634. return 1;
  635. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement