Guest User

Untitled

a guest
Jan 15th, 2012
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.66 KB | None | 0 0
  1. /*
  2. ________________________________________
  3.  
  4. Basic Roleplay :: Red County :: Aprezt
  5. ________________________________________
  6.  
  7. Map:
  8. >> Red County
  9. Scripter(s):
  10. >> Aprezt
  11. Script Version:
  12. >> U1
  13.  
  14. Thanks to Kush'is. Y_INI Tutorial :)
  15. */
  16.  
  17. /* Server Includes */
  18. #include <a_samp>
  19. #include <streamer>
  20. #include <zcmd>
  21. #include <foreach>
  22. #include <sscanf2>
  23. #include <YSI\y_ini>
  24.  
  25. /* Server Colors */
  26. #define COLOR_PURPLE 0xC2A2DAAA
  27. #define COLOR_GRAD2 0xBFC0C2FF
  28. #define COLOR_GRAD1 0xB4B5B7FF
  29. #define COLOR_GRAD2 0xBFC0C2FF
  30. #define COLOR_GREY 0xAFAFAFAA
  31. #define COLOR_GRAD3 0xCBCCCEFF
  32. #define COLOR_LIGHTBLUE 0x006FDD96
  33. #define COLOR_GRAD4 0xD8D8D8FF
  34. #define COLOR_FADE 0xC8C8C8C8
  35. #define COLOR_FADE2 0xC8C8C8C8
  36. #define COLOR_FADE3 0xAAAAAAAA
  37. #define COLOR_FADE4 0x8C8C8C8C
  38. #define COLOR_YELLOW 0xDABB3E00
  39. #define COLOR_FADE5 0x6E6E6E6E
  40. #define COLOR_GRAD5 0xE3E3E3FF
  41. #define COLOR_FADE1 0xE6E6E6E6
  42. #define COLOR_GRAD6 0xF0F0F0FF
  43. #define TEAM_HIT_COLOR 0xFFFFFF00
  44.  
  45. /* Server Defines */
  46. #define PATH "Accounts/%s.ini"
  47. #define SECONDS(%1) ((%1)*(1000))
  48. #define ALTCOMMAND:%1->%2; \
  49. COMMAND:%1(playerid, params[]) \
  50. return cmd_%2(playerid, params);
  51. #define function%0(%1) forward%0(%1); public%0(%1)
  52.  
  53. /* SERVER SIDE CASH */
  54. #define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
  55. #define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
  56. #define GetPlayerCash(%0) GetPVarInt(%0,"Money")
  57.  
  58. /* DIALOGS */
  59. #define DIALOG_REGISTER 1
  60. #define DIALOG_LOGIN 2
  61. #define DIALOG_AGE 3
  62. #define DIALOG_SEX 4
  63.  
  64. /* ENUMS */
  65. enum pInfo
  66. {
  67. pPass,
  68. pCash,
  69. pAdmin,
  70. pSex,
  71. pAge,
  72. Float:pPos_x,
  73. Float:pPos_y,
  74. Float:pPos_z,
  75. pSkin,
  76. pTeam,
  77. pAccent
  78. }
  79. new PlayerInfo[MAX_PLAYERS][pInfo];
  80. /* <--------------------------------------------> */
  81.  
  82. main()
  83. {
  84. print(" ");
  85. print(" ");
  86. print("- Basic Roleplay GameMode Loaded -");
  87. print(" ");
  88. print(" Script: Aprezt");
  89. }
  90.  
  91. new
  92. noooc = 0,
  93. gOoc[ MAX_PLAYERS ]
  94. ;
  95.  
  96. public OnPlayerConnect(playerid)
  97. {
  98. gOoc[playerid] = 0;
  99.  
  100. if(fexist(UserPath(playerid)))
  101. {
  102. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  103. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Basic Roleplay","Type your password below to login:","Login","Quit");
  104. }
  105. else
  106. {
  107. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Basic Roleplay","Type your password below to register a new account:","Register","Quit");
  108. }
  109. return 1;
  110. }
  111.  
  112. public OnGameModeInit()
  113. {
  114. ShowPlayerMarkers(0);
  115. ShowNameTags(1);
  116. DisableInteriorEnterExits();
  117. EnableStuntBonusForAll(0);
  118. SetNameTagDrawDistance(10.0);
  119. // =========== TIMERS ===========
  120. SetTimer("MoneyUpdate",1000,1);
  121. SetTimer("SaveAccounts", SECONDS(13), 1);
  122. return 1;
  123. }
  124.  
  125. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  126. {
  127. if(dialogid == DIALOG_AGE)
  128. {
  129. if(!response)
  130. {
  131. Kick(playerid);
  132. }
  133. else
  134. {
  135. if(strlen(inputtext))
  136. {
  137. new age = strval(inputtext);
  138. if(age > 100 || age < 16)
  139. {
  140. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
  141. }
  142. else
  143. {
  144. PlayerInfo[playerid][pAge] = age;
  145. new
  146. string[ 64 ]
  147. ;
  148. format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
  149. SendClientMessage(playerid, -1, string);
  150. GivePlayerCash(playerid, 600);
  151. SaveAccountStats(playerid);
  152. SpawnPlayer(playerid);
  153. }
  154. }
  155. else
  156. {
  157. return 0;
  158. }
  159. }
  160. }
  161. if(dialogid == DIALOG_SEX)
  162. {
  163. if(response)
  164. {
  165. PlayerInfo[playerid][pSex] = 1;
  166. SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
  167. SetPlayerSkin(playerid, 60);
  168. PlayerInfo[playerid][pSkin] = 60;
  169. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
  170. }
  171. else
  172. {
  173. PlayerInfo[playerid][pSex] = 2;
  174. SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
  175. SetPlayerSkin(playerid, 233);
  176. PlayerInfo[playerid][pSkin] = 233;
  177. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
  178. }
  179. }
  180. switch( dialogid )
  181. {
  182. case DIALOG_REGISTER:
  183. {
  184. if (!response) return Kick(playerid);
  185. if(response)
  186. {
  187. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
  188. new INI:File = INI_Open(UserPath(playerid));
  189. INI_SetTag(File,"data");
  190. INI_WriteInt(File,"Password",udb_hash(inputtext));
  191. INI_WriteInt(File,"Cash",0);
  192. INI_WriteInt(File,"Admin",0);
  193. INI_WriteInt(File,"Sex",0);
  194. INI_WriteInt(File,"Age",0);
  195. INI_WriteFloat(File,"Pos_x",0);
  196. INI_WriteFloat(File,"Pos_y",0);
  197. INI_WriteFloat(File,"Pos_z",0);
  198. INI_WriteInt(File,"Skin",0);
  199. INI_WriteInt(File,"Team",0);
  200. INI_WriteInt(File,"Accent",0);
  201. INI_Close(File);
  202.  
  203. ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "- Sex -","What gender are you?","Male","Female");
  204. }
  205. }
  206. case DIALOG_LOGIN:
  207. {
  208. if ( !response ) return Kick ( playerid );
  209. if( response )
  210. {
  211. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  212. {
  213. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  214. new
  215. tmp2[ 256 ],
  216. playername2[ MAX_PLAYER_NAME ]
  217. ;
  218. GetPlayerName(playerid, playername2, sizeof(playername2));
  219. format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
  220. GameTextForPlayer(playerid, tmp2, 5000, 1);
  221. SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
  222. GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  223. SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
  224. }
  225. else
  226. {
  227. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
  228. }
  229. return 1;
  230. }
  231. }
  232. }
  233. return 1;
  234. }
  235.  
  236. public OnPlayerSpawn(playerid)
  237. {
  238. if(IsPlayerConnected(playerid))
  239. {
  240. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  241. SetPlayerToTeamColor(playerid);
  242. }
  243. if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
  244. {
  245. SetPlayerPos(playerid, 1271.3654,181.0756,19.4705);
  246. }
  247. else
  248. {
  249. SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
  250. }
  251. return 1;
  252. }
  253.  
  254. public OnPlayerText(playerid, text[])
  255. {
  256. new
  257. realchat = 1,
  258. string[ 128 ]
  259. ;
  260. if(IsPlayerConnected(playerid))
  261. {
  262. if(realchat)
  263. {
  264. if(PlayerInfo[playerid][pAccent] == 0)
  265. {
  266. format(string, sizeof(string), "%s says: %s", RPName(playerid), text);
  267. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  268. }
  269. else
  270. {
  271. new
  272. accent[20]
  273. ;
  274. switch(PlayerInfo[playerid][pAccent])
  275. {
  276. case 1: accent = "Russian";
  277. case 2: accent = "Italian";
  278. case 3: accent = "Germany";
  279. case 4: accent = "Japanese";
  280. case 5: accent = "French";
  281. case 6: accent = "Spain";
  282. case 7: accent = "China";
  283. case 8: accent = "British";
  284. }
  285. format(string, sizeof(string), "%s says: [%s Accent] %s", RPName(playerid), accent, text);
  286. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  287. }
  288. return 0;
  289. }
  290. }
  291. return 1;
  292. }
  293.  
  294. public OnPlayerDisconnect(playerid, reason)
  295. {
  296. SaveAccountStats(playerid);
  297. return 1;
  298. }
  299.  
  300. function SetPlayerToTeamColor(playerid)
  301. {
  302. if(IsPlayerConnected(playerid))
  303. {
  304. SetPlayerColor(playerid,TEAM_HIT_COLOR);
  305. }
  306. }
  307.  
  308. function OOCOff(color,const string[])
  309. {
  310. foreach (Player,i)
  311. {
  312. if(!gOoc{i})
  313. {
  314. SendClientMessage(i, color, string);
  315. }
  316. }
  317. }
  318.  
  319. function SaveAccountStats(playerid)
  320. {
  321. new
  322. INI:File = INI_Open(UserPath(playerid))
  323. ;
  324. INI_SetTag(File,"data");
  325.  
  326. PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
  327. PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
  328. new
  329. Float:x,
  330. Float:y,
  331. Float:z
  332. ;
  333. GetPlayerPos(playerid,x,y,z);
  334. PlayerInfo[playerid][pPos_x] = x;
  335. PlayerInfo[playerid][pPos_y] = y;
  336. PlayerInfo[playerid][pPos_z] = z;
  337.  
  338. INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
  339. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  340. INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
  341. INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
  342. INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
  343. INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
  344. INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
  345. INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
  346. INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
  347. INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
  348.  
  349. INI_Close(File);
  350. return 1;
  351. }
  352.  
  353. function SaveAccounts()
  354. {
  355. for(new i = 0; i < MAX_PLAYERS; i++)
  356. {
  357. if(IsPlayerConnected(i))
  358. {
  359. SaveAccountStats(i);
  360. }
  361. }
  362. }
  363.  
  364. function GameModeExitFunc()
  365. {
  366. GameModeExit();
  367. return 1;
  368. }
  369.  
  370. function LoadUser_data(playerid,name[],value[])
  371. {
  372. INI_Int("Password",PlayerInfo[playerid][pPass]);
  373. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  374. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  375. INI_Int("Sex",PlayerInfo[playerid][pSex]);
  376. INI_Int("Age",PlayerInfo[playerid][pAge]);
  377. INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]);
  378. INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]);
  379. INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]);
  380. INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  381. INI_Int("Team",PlayerInfo[playerid][pTeam]);
  382. INI_Int("Accent",PlayerInfo[playerid][pAccent]);
  383. return 1;
  384. }
  385.  
  386. function MoneyUpdate(playerid)
  387. {
  388. if(GetPlayerCash(playerid) < GetPlayerMoney(playerid))
  389. {
  390. foreach(Player, i)
  391. {
  392. new const old_money = GetPlayerCash(playerid);
  393. ResetPlayerCash(playerid), GivePlayerCash(playerid, old_money);
  394. }
  395. }
  396. return 1;
  397. }
  398.  
  399. function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  400. {
  401. if(IsPlayerConnected(playerid))
  402. {
  403. new Float:posx, Float:posy, Float:posz;
  404. new BigEar[MAX_PLAYERS];
  405. new Float:oldposx, Float:oldposy, Float:oldposz;
  406. new Float:tempposx, Float:tempposy, Float:tempposz;
  407. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  408. for(new i = 0; i < MAX_PLAYERS; i++)
  409. {
  410. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  411. {
  412. if(!BigEar[i])
  413. {
  414. GetPlayerPos(i, posx, posy, posz);
  415. tempposx = (oldposx -posx);
  416. tempposy = (oldposy -posy);
  417. tempposz = (oldposz -posz);
  418. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  419. {
  420. SendClientMessage(i, col1, string);
  421. }
  422. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  423. {
  424. SendClientMessage(i, col2, string);
  425. }
  426. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  427. {
  428. SendClientMessage(i, col3, string);
  429. }
  430. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  431. {
  432. SendClientMessage(i, col4, string);
  433. }
  434. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  435. {
  436. SendClientMessage(i, col5, string);
  437. }
  438. }
  439. else
  440. {
  441. SendClientMessage(i, col1, string);
  442. }
  443. }
  444. }
  445. }
  446. return 1;
  447. }
  448.  
  449. // ============ STOCKS ============
  450. stock SendAdminMessage( color, string[] )
  451. {
  452. foreach (Player,i)
  453. {
  454. if( PlayerInfo[ i] [ pAdmin ] > 1 )
  455. {
  456. SendClientMessage( i, color, string );
  457. }
  458. }
  459. }
  460.  
  461. stock UserPath(playerid)
  462. {
  463. new string[128],playername[MAX_PLAYER_NAME];
  464. GetPlayerName(playerid,playername,sizeof(playername));
  465. format(string,sizeof(string),PATH,playername);
  466. return string;
  467. }
  468.  
  469. /* Credits to Dracoblue */
  470. stock udb_hash(buf[]) {
  471. new length=strlen(buf);
  472. new s1 = 1;
  473. new s2 = 0;
  474. new n;
  475. for (n=0; n<length; n++)
  476. {
  477. s1 = (s1 + buf[n]) % 65521;
  478. s2 = (s2 + s1) % 65521;
  479. }
  480. return (s2 << 16) + s1;
  481. }
  482.  
  483. stock RPName(playerid)
  484. {
  485. new string[24];
  486. GetPlayerName(playerid,string,24);
  487. new str[24];
  488. strmid(str,string,0,strlen(string),24);
  489. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  490. {
  491. if (str[i] == '_') str[i] = ' ';
  492. }
  493. return str;
  494. }
  495. // =================================
  496.  
  497. /* LOGS */
  498.  
  499. function OOCLog(string[])
  500. {
  501. new
  502. entry[ 128 ],
  503. year,
  504. month,
  505. day,
  506. hour,
  507. minute,
  508. second
  509. ;
  510. getdate(year, month, day);
  511. gettime(hour, minute, second);
  512.  
  513. format(entry, sizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",string, day, month, year, hour, minute, second);
  514. new File:hFile;
  515. hFile = fopen("Basic/logs/OOCLog.log", io_append);
  516. fwrite(hFile, entry);
  517. fclose(hFile);
  518. }
  519.  
  520. /* COMMANDS */
  521.  
  522. CMD:stats(playerid, params[])
  523. {
  524. if(IsPlayerConnected(playerid))
  525. {
  526. new
  527. string[ 128 ],
  528. Age = PlayerInfo[ playerid ][ pAge ],
  529. Money = GetPlayerCash( playerid )
  530. ;
  531.  
  532. new Sex[20];
  533. if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Male"; }
  534. else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Female"; }
  535.  
  536. SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
  537. format(string, sizeof(string), "Name: %s | Money: %d | Age: %d | Sex: %s", RPName(playerid), Money, Age, Sex);
  538. SendClientMessage(playerid, COLOR_GRAD2, string);
  539. }
  540. return 1;
  541. }
  542.  
  543. CMD:ahelp(playerid, params[])
  544. {
  545. if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1,"You are not admin!");
  546. SendClientMessage(playerid, -1, "____________________________________________________________________");
  547. if(PlayerInfo[playerid][pAdmin] >= 1)
  548. {
  549. SendClientMessage(playerid, COLOR_FADE, "Level 1: No commands yet!");
  550. }
  551. if(PlayerInfo[playerid][pAdmin] >= 2)
  552. {
  553. SendClientMessage(playerid, COLOR_FADE, "Level 2: No commands yet!");
  554. }
  555. if(PlayerInfo[playerid][pAdmin] >= 3)
  556. {
  557. SendClientMessage(playerid, COLOR_FADE, "Level 3: No commands yet!");
  558. }
  559. if(PlayerInfo[playerid][pAdmin] >= 4)
  560. {
  561. SendClientMessage(playerid, COLOR_FADE, "Level 4: No commands yet!");
  562. }
  563. if(PlayerInfo[playerid][pAdmin] >= 5)
  564. {
  565. SendClientMessage(playerid, COLOR_FADE, "Level 5: No commands yet!");
  566. }
  567. if(PlayerInfo[playerid][pAdmin] >= 6)
  568. {
  569. SendClientMessage(playerid, COLOR_FADE, "Level 6: No commands yet!");
  570. }
  571. if(PlayerInfo[playerid][pAdmin] >= 1337)
  572. {
  573. SendClientMessage(playerid, COLOR_FADE, "Level 1337: /givemoney -");
  574. }
  575. SendClientMessage(playerid, -1, "____________________________________________________________________");
  576. return 1;
  577. }
  578.  
  579. CMD:help(playerid, params[])
  580. {
  581. SendClientMessage(playerid, COLOR_LIGHTBLUE,"------------------------------------------------------------");
  582. SendClientMessage(playerid, COLOR_GRAD2,"/do - /me - /accent - /ooc - /b");
  583. SendClientMessage(playerid, COLOR_LIGHTBLUE,"------------------------------------------------------------");
  584. return 1;
  585. }
  586.  
  587. ALTCOMMAND:o->ooc;
  588. CMD:ooc(playerid, params[])
  589. {
  590. new
  591. string[ 186 ]
  592. ;
  593. if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "OOC Chat closed by administrator!");
  594. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}(/o)oc [ooc chat]");
  595.  
  596. format(string, sizeof(string), "(( OOC: %s: %s ))", RPName(playerid), params);
  597. OOCOff(0xCCFFFF00, string);
  598. OOCLog(string);
  599. printf("%s", string);
  600. return 1;
  601. }
  602.  
  603. CMD:b(playerid, params[])
  604. {
  605. new
  606. string[ 128 ]
  607. ;
  608. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF} /b [ooc chat]");
  609. format(string, sizeof(string), "(( OOC: %s[%i]: %s ))", RPName( playerid ), playerid, params);
  610. printf("%s", string);
  611. ProxDetector(30.0, playerid, string, COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE);
  612. return 1;
  613. }
  614.  
  615. CMD:do(playerid, params[])
  616. {
  617. new
  618. result[ 128 ],
  619. string[ 128 ]
  620. ;
  621. if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/do [action]");
  622. format(string, sizeof(string), "* %s (( %s ))", result, RPName(playerid));
  623. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  624. printf("%s", string);
  625. return 1;
  626. }
  627.  
  628. CMD:me(playerid, params[])
  629. {
  630. new
  631. result[ 128 ],
  632. string[ 128 ]
  633. ;
  634. if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/do [action]");
  635. format(string, sizeof(string), "* %s %s", RPName(playerid), result);
  636. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  637. printf("%s", string);
  638. return 1;
  639. }
  640.  
  641. CMD:accent(playerid, params[])
  642. {
  643. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: {FFFFFF}/accent [russian | italian | germany | japanese | french | spain | china | british | none]");
  644. if(!strcmp(params,"russian",true))
  645. {
  646. PlayerInfo[playerid][pAccent] = 1;
  647. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now Russian!");
  648. }
  649. else if(!strcmp(params,"italian",true))
  650. {
  651. PlayerInfo[playerid][pAccent] = 2;
  652. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now Italian!");
  653. }
  654. else if(!strcmp(params,"germany",true))
  655. {
  656. PlayerInfo[playerid][pAccent] = 3;
  657. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now Germany!");
  658. }
  659. else if(!strcmp(params,"japanese",true))
  660. {
  661. PlayerInfo[playerid][pAccent] = 4;
  662. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now Japanese!");
  663. }
  664. else if(!strcmp(params,"french",true))
  665. {
  666. PlayerInfo[playerid][pAccent] = 5;
  667. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now French!");
  668. }
  669. else if(!strcmp(params,"spain",true))
  670. {
  671. PlayerInfo[playerid][pAccent] = 6;
  672. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now Spain!");
  673. }
  674. else if(!strcmp(params,"china",true))
  675. {
  676. PlayerInfo[playerid][pAccent] = 7;
  677. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now China!");
  678. }
  679. else if(!strcmp(params,"british", true))
  680. {
  681. PlayerInfo[playerid][pAccent] = 8;
  682. SendClientMessage(playerid, COLOR_GRAD1, "Your accent is now British!");
  683. }
  684. else if(!strcmp(params,"none",true))
  685. {
  686. PlayerInfo[playerid][pAccent] = 0;
  687. SendClientMessage(playerid, COLOR_GRAD1, "You removed the accent!");
  688. }
  689. else return SendClientMessage(playerid, COLOR_GREY, "Invalid name accent!");
  690. return 1;
  691. }
  692.  
  693. CMD:givemoney(playerid, params[])
  694. {
  695. new targetid,type,string[128];
  696. if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
  697. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
  698. if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
  699. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");
  700.  
  701. GivePlayerCash(targetid, type);
  702. format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
  703. SendAdminMessage(COLOR_YELLOW,string);
  704. return 1;
  705. }
Advertisement
Add Comment
Please, Sign In to add comment