Guest User

SamasSky v1.0

a guest
Jan 23rd, 2016
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.41 KB | None | 0 0
  1. /*
  2. ________________________________________
  3.  
  4. SampasSky V1.0
  5. ________________________________________
  6.  
  7.  
  8.  
  9. Y_INI tutoralu deka darytas gm :)
  10. */
  11.  
  12.  
  13. #include <a_samp>
  14. #include <streamer>
  15. #include <zcmd>
  16. #include <foreach>
  17. #include <sscanf2>
  18. #include <YSI\y_ini>
  19.  
  20.  
  21. #define COLOR_PURPLE 0xC2A2DAAA
  22. #define COLOR_GRAD2 0xBFC0C2FF
  23. #define COLOR_GRAD1 0xB4B5B7FF
  24. #define COLOR_GRAD2 0xBFC0C2FF
  25. #define COLOR_GREY 0xAFAFAFAA
  26. #define COLOR_GRAD3 0xCBCCCEFF
  27. #define COLOR_LIGHTBLUE 0x006FDD96
  28. #define COLOR_GRAD4 0xD8D8D8FF
  29. #define COLOR_FADE 0xC8C8C8C8
  30. #define COLOR_FADE2 0xC8C8C8C8
  31. #define COLOR_FADE3 0xAAAAAAAA
  32. #define COLOR_FADE4 0x8C8C8C8C
  33. #define COLOR_YELLOW 0xDABB3E00
  34. #define COLOR_FADE5 0x6E6E6E6E
  35. #define COLOR_GRAD5 0xE3E3E3FF
  36. #define COLOR_FADE1 0xE6E6E6E6
  37. #define COLOR_GRAD6 0xF0F0F0FF
  38. #define TEAM_HIT_COLOR 0xFFFFFF00
  39.  
  40.  
  41. #define PATH "vartotojai/%s.ini"
  42. #define SECONDS(%1) ((%1)*(1000))
  43. #define ALTCOMMAND:%1->%2; \
  44. COMMAND:%1(playerid, params[]) \
  45. return cmd_%2(playerid, params);
  46. #define function%0(%1) forward%0(%1); public%0(%1)
  47.  
  48.  
  49. #define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
  50. #define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
  51. #define GetPlayerCash(%0) GetPVarInt(%0,"Money")
  52.  
  53.  
  54. #define DIALOG_REGISTER 1
  55. #define DIALOG_LOGIN 2
  56. #define DIALOG_AGE 3
  57. #define DIALOG_SEX 4
  58.  
  59.  
  60. enum pInfo
  61. {
  62. pPass,
  63. pCash,
  64. pAdmin,
  65. pSex,
  66. pAge,
  67. Float:pPos_x,
  68. Float:pPos_y,
  69. Float:pPos_z,
  70. pSkin,
  71. pTeam,
  72. pAccent
  73. }
  74. new PlayerInfo[MAX_PLAYERS][pInfo];
  75.  
  76.  
  77. main()
  78. {
  79. print(" ");
  80. print(" ");
  81. print("- SampSky GameMode paleistas -");
  82. print(" ");
  83. print(" Kodas: SampSky");
  84. }
  85.  
  86. new
  87. noooc = 0,
  88. Logged[ MAX_PLAYERS ],
  89. gOoc[ MAX_PLAYERS ]
  90. ;
  91.  
  92. public OnPlayerConnect(playerid)
  93. {
  94. gOoc[ playerid ] = 0; Logged[ playerid ] = 0;
  95.  
  96. PlayerInfo[ playerid ][ pCash ] = 0;
  97. PlayerInfo[ playerid ][ pAdmin ] = 0;
  98. PlayerInfo[ playerid ][ pSex ] = 0;
  99. PlayerInfo[ playerid ][ pAge ] = 0;
  100. PlayerInfo[ playerid ][ pPos_x ] = 0.0;
  101. PlayerInfo[ playerid ][ pPos_y ] = 0.0;
  102. PlayerInfo[ playerid ][ pPos_z ] = 0.0;
  103. PlayerInfo[ playerid ][ pSkin ] = 0;
  104. PlayerInfo[ playerid ][ pTeam ] = 0;
  105. PlayerInfo[ playerid ][ pAccent ] = 0;
  106.  
  107. if(fexist(UserPath(playerid)))
  108. {
  109. INI_ParseFile(UserPath(playerid), "vartotojai_%s", .bExtra = true, .extra = playerid);
  110. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"True-Life.lt","Įvesk savo slaptažodį jei nori prisijungti:","Prisijungti","Išeiti");
  111. }
  112. else
  113. {
  114. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"True-Life.lt","Įvesk savo slaptažodį jei nori užsiregistruoti serveryje:","Registruotis","Išeiti");
  115. }
  116. return 1;
  117. }
  118.  
  119. public OnGameModeInit()
  120. {
  121.  
  122. AddPlayerClass(21,-2382.0168,-582.0441,132.1172,125.2504,0,0,0,0,0,0);
  123. AddPlayerClass(59,-2382.0168,-582.0441,132.1172,125.2504,0,0,0,0,0,0);
  124.  
  125. ShowPlayerMarkers(0);
  126. ShowNameTags(1);
  127. DisableInteriorEnterExits();
  128. EnableStuntBonusForAll(0);
  129. SetNameTagDrawDistance(10.0);
  130.  
  131. SetTimer("pinigai",1000,1);
  132. SetTimer("išsaugotivartotojus", SECONDS(13), 1);
  133. return 1;
  134. }
  135.  
  136. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  137. {
  138. if(dialogid == DIALOG_AGE)
  139. {
  140. if(!response)
  141. {
  142. Kick(playerid);
  143. }
  144. else
  145. {
  146. if(strlen(inputtext))
  147. {
  148. new age = strval(inputtext);
  149. if(age > 30 || age < 8)
  150. {
  151. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Jūsų amžius -","Kiek tau metų?\n{FF0000}(( 8 - 30 ))","Atsakyti","Išeiti");
  152. }
  153. else
  154. {
  155. PlayerInfo[playerid][pAge] = age;
  156. new
  157. string[ 64 ]
  158. ;
  159. format(string, sizeof(string), "Informacija: Tu {3BB9FF}%d metų.",age);
  160. SendClientMessage(playerid, -1, string);
  161. GivePlayerCash(playerid, 600);
  162. SaveAccountStats(playerid);
  163. SpawnPlayer(playerid);
  164. }
  165. }
  166. else
  167. {
  168. return 0;
  169. }
  170. }
  171. }
  172. if(dialogid == DIALOG_SEX)
  173. {
  174. if(response)
  175. {
  176. PlayerInfo[playerid][pSex] = 1;
  177. SendClientMessage(playerid, -1, "informacija: Tu esi {3BB9FF}vyras.");
  178. SetPlayerSkin(playerid, 60);
  179. PlayerInfo[playerid][pSkin] = 60;
  180. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Jūsų amžius -","Kiek tau metų?\n{FF0000}(( 8 - 30 ))","Atsakyti","Išeiti");
  181. }
  182. else
  183. {
  184. PlayerInfo[playerid][pSex] = 2;
  185. SendClientMessage(playerid, -1, "informacija: Tu esi {3BB9FF}moteris.");
  186. SetPlayerSkin(playerid, 233);
  187. PlayerInfo[playerid][pSkin] = 233;
  188. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Jūsų amžius -","Kiek tau metų?\n{FF0000}(( 8 - 30 ))","Atsakyti","Išeiti");
  189. }
  190. }
  191. switch( dialogid )
  192. {
  193. case DIALOG_REGISTER:
  194. {
  195. if (!response) return Kick(playerid);
  196. if(response)
  197. {
  198. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registracija...","Tu įvedei netinkama slaptažodį.\nĮvesk savo slaptažodį jei nori sukurti paskyrą.","Registruotis","Išeiti");
  199. new INI:File = INI_Open(UserPath(playerid));
  200. INI_SetTag(File,"data");
  201. INI_WriteInt(File,"slaptažodis",udb_hash(inputtext));
  202. INI_WriteInt(File,"pinigai",0);
  203. INI_WriteInt(File,"Admin'as",0);
  204. INI_WriteInt(File,"lytis",0);
  205. INI_WriteInt(File,"amžius",0);
  206. INI_WriteFloat(File,"Pozicija_x",0);
  207. INI_WriteFloat(File,"Pozicija_y",0);
  208. INI_WriteFloat(File,"Pozicija_z",0);
  209. INI_WriteInt(File,"Skin'as",0);
  210. INI_WriteInt(File,"komanda",0);
  211. INI_WriteInt(File,"Akcentas",0);
  212. INI_Close(File);
  213.  
  214. ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "- Jūsų lytis -","Pasirink lyti","Vyras","Moteris");
  215. }
  216. }
  217. case DIALOG_LOGIN:
  218. {
  219. if ( !response ) return Kick ( playerid );
  220. if( response )
  221. {
  222. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  223. {
  224. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  225. new
  226. tmp2[ 256 ],
  227. playername2[ MAX_PLAYER_NAME ]
  228. ;
  229. GetPlayerName(playerid, playername2, sizeof(playername2));
  230. format(tmp2, sizeof(tmp2), "~w~Sveikas ~n~~g~%s", playername2);
  231. GameTextForPlayer(playerid, tmp2, 5000, 1);
  232. SetTimerEx("pirmasspawnas", 5000, false, "i", playerid);
  233. GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  234. 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);
  235. }
  236. else
  237. {
  238. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Prisijungimas","Tu įvedei netinkama slaptažodį.\nĮvesk savo slaptažodį jei nori prisijungti.","Prisijungti","Išeiti");
  239. }
  240. return 1;
  241. }
  242. }
  243. }
  244. return 1;
  245. }
  246.  
  247. public OnPlayerSpawn(playerid)
  248. {
  249. if(IsPlayerConnected(playerid))
  250. {
  251. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  252. SetPlayerToTeamColor(playerid);
  253. Logged[playerid] = 1;
  254. }
  255. if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
  256. {
  257. SetPlayerPos(playerid, 1271.3654,181.0756,19.4705);
  258. Logged[playerid] = 1;
  259. }
  260. else
  261. {
  262. SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
  263. Logged[playerid] = 1;
  264. }
  265. return 1;
  266. }
  267.  
  268. public OnPlayerText(playerid, text[])
  269. {
  270. new
  271. realchat = 1,
  272. string[ 128 ]
  273. ;
  274. if(IsPlayerConnected(playerid))
  275. {
  276. if(realchat)
  277. {
  278. if(PlayerInfo[playerid][pAccent] == 0)
  279. {
  280. format(string, sizeof(string), "%s sako: %s", RPName(playerid), text);
  281. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  282. }
  283. else
  284. {
  285. new
  286. accent[20]
  287. ;
  288. switch(PlayerInfo[playerid][pAccent])
  289. {
  290. case 1: accent = "Lietuviškas";
  291. case 2: accent = "Rusiškas";
  292. case 3: accent = "Vokiškas";
  293. case 4: accent = "Angliškas";
  294. }
  295. format(string, sizeof(string), "%s sako: [%s akcentas] %s", RPName(playerid), accent, text);
  296. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  297. }
  298. return 0;
  299. }
  300. }
  301. return 1;
  302. }
  303.  
  304. public OnPlayerDisconnect(playerid, reason)
  305. {
  306. SaveAccountStats(playerid);
  307. return 1;
  308. }
  309.  
  310. function SetPlayerToTeamColor(playerid)
  311. {
  312. if(IsPlayerConnected(playerid))
  313. {
  314. SetPlayerColor(playerid,TEAM_HIT_COLOR);
  315. }
  316. }
  317.  
  318. function OOCOff(color,const string[])
  319. {
  320. foreach (Player,i)
  321. {
  322. if(!gOoc{i})
  323. {
  324. SendClientMessage(i, color, string);
  325. }
  326. }
  327. }
  328.  
  329. function SaveAccountStats(playerid)
  330. {
  331. if(Logged[playerid] == 1)
  332. {
  333. new
  334. INI:File = INI_Open(UserPath(playerid))
  335. ;
  336. INI_SetTag(File,"data");
  337.  
  338. PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
  339. PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
  340. new
  341. Float:x,
  342. Float:y,
  343. Float:z
  344. ;
  345. GetPlayerPos(playerid,x,y,z);
  346. PlayerInfo[playerid][pPos_x] = x;
  347. PlayerInfo[playerid][pPos_y] = y;
  348. PlayerInfo[playerid][pPos_z] = z;
  349.  
  350. INI_WriteInt(File,"pinigai",PlayerInfo[playerid][pCash]);
  351. INI_WriteInt(File,"admin'as",PlayerInfo[playerid][pAdmin]);
  352. INI_WriteInt(File,"lytis",PlayerInfo[playerid][pSex]);
  353. INI_WriteInt(File,"amžius",PlayerInfo[playerid][pAge]);
  354. INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
  355. INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
  356. INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
  357. INI_WriteInt(File,"skin'as",PlayerInfo[playerid][pSkin]);
  358. INI_WriteInt(File,"komanda",PlayerInfo[playerid][pTeam]);
  359. INI_WriteInt(File,"akcentas",PlayerInfo[playerid][pAccent]);
  360.  
  361. INI_Close(File);
  362. }
  363. return 1;
  364. }
  365.  
  366. function SaveAccounts()
  367. {
  368. for(new i = 0; i < MAX_PLAYERS; i++)
  369. {
  370. if(IsPlayerConnected(i))
  371. {
  372. SaveAccountStats(i);
  373. }
  374. }
  375. }
  376.  
  377. function GameModeExitFunc()
  378. {
  379. GameModeExit();
  380. return 1;
  381. }
  382.  
  383. function LoadUser_data(playerid,name[],value[])
  384. {
  385. INI_Int("slaptažodis",PlayerInfo[playerid][pPass]);
  386. INI_Int("pinigai",PlayerInfo[playerid][pCash]);
  387. INI_Int("admin'as",PlayerInfo[playerid][pAdmin]);
  388. INI_Int("lytis",PlayerInfo[playerid][pSex]);
  389. INI_Int("amžius",PlayerInfo[playerid][pAge]);
  390. INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]);
  391. INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]);
  392. INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]);
  393. INI_Int("skin'as",PlayerInfo[playerid][pSkin]);
  394. INI_Int("komanda",PlayerInfo[playerid][pTeam]);
  395. return 1;
  396. }
  397.  
  398. function eurai(playerid)
  399. {
  400. if(GetPlayerCash(playerid) < GetPlayerMoney(playerid))
  401. {
  402. foreach(Player, i)
  403. {
  404. new const old_money = GetPlayerCash(playerid);
  405. ResetPlayerCash(playerid), GivePlayerCash(playerid, old_money);
  406. }
  407. }
  408. return 1;
  409. }
  410.  
  411. function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  412. {
  413. if(IsPlayerConnected(playerid))
  414. {
  415. new Float:posx, Float:posy, Float:posz;
  416. new BigEar[MAX_PLAYERS];
  417. new Float:oldposx, Float:oldposy, Float:oldposz;
  418. new Float:tempposx, Float:tempposy, Float:tempposz;
  419. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  420. for(new i = 0; i < MAX_PLAYERS; i++)
  421. {
  422. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  423. {
  424. if(!BigEar[i])
  425. {
  426. GetPlayerPos(i, posx, posy, posz);
  427. tempposx = (oldposx -posx);
  428. tempposy = (oldposy -posy);
  429. tempposz = (oldposz -posz);
  430. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  431. {
  432. SendClientMessage(i, col1, string);
  433. }
  434. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  435. {
  436. SendClientMessage(i, col2, string);
  437. }
  438. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  439. {
  440. SendClientMessage(i, col3, string);
  441. }
  442. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  443. {
  444. SendClientMessage(i, col4, string);
  445. }
  446. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  447. {
  448. SendClientMessage(i, col5, string);
  449. }
  450. }
  451. else
  452. {
  453. SendClientMessage(i, col1, string);
  454. }
  455. }
  456. }
  457. }
  458. return 1;
  459. }
  460.  
  461. stock SendAdminMessage( color, string[] )
  462. {
  463. foreach (Player,i)
  464. {
  465. if( PlayerInfo[ i] [ pAdmin ] > 1 )
  466. {
  467. SendClientMessage( i, color, string );
  468. }
  469. }
  470. }
  471.  
  472. stock UserPath(playerid)
  473. {
  474. new string[128],playername[MAX_PLAYER_NAME];
  475. GetPlayerName(playerid,playername,sizeof(playername));
  476. format(string,sizeof(string),PATH,playername);
  477. return string;
  478. }
  479.  
  480. stock udb_hash(buf[]) {
  481. new length=strlen(buf);
  482. new s1 = 1;
  483. new s2 = 0;
  484. new n;
  485. for (n=0; n<length; n++)
  486. {
  487. s1 = (s1 + buf[n]) % 65521;
  488. s2 = (s2 + s1) % 65521;
  489. }
  490. return (s2 << 16) + s1;
  491. }
  492.  
  493. stock RPName(playerid)
  494. {
  495. new string[24];
  496. GetPlayerName(playerid,string,24);
  497. new str[24];
  498. strmid(str,string,0,strlen(string),24);
  499. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  500. {
  501. if (str[i] == '_') str[i] = ' ';
  502. }
  503. return str;
  504. }
  505.  
  506. function logai(string[])
  507. {
  508. new
  509. entry[ 128 ],
  510. year,
  511. month,
  512. day,
  513. hour,
  514. minute,
  515. second
  516. ;
  517. getdate(year, month, day);
  518. gettime(hour, minute, second);
  519.  
  520. format(entry, sizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",string, day, month, year, hour, minute, second);
  521. new File:hFile;
  522. hFile = fopen("logai/Logai.log", io_append);
  523. fwrite(hFile, entry);
  524. fclose(hFile);
  525. }
  526.  
  527.  
  528. CMD:statistika(playerid, params[])
  529. {
  530. if(IsPlayerConnected(playerid))
  531. {
  532. new
  533. string[ 128 ],
  534. Age = PlayerInfo[ playerid ][ pAge ],
  535. Money = GetPlayerCash( playerid )
  536. ;
  537.  
  538. new Sex[20];
  539. if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Vyras"; }
  540. else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Moteris"; }
  541.  
  542. SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
  543. format(string, sizeof(string), "Vardas_Pavardė: %s | Pinigai: %d | Amžius: %d | Lytis: %s", RPName(playerid), Money, Age, Sex);
  544. SendClientMessage(playerid, COLOR_GRAD2, string);
  545. }
  546. return 1;
  547. }
  548.  
  549. CMD:apagalba(playerid, params[])
  550. {
  551. if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1,"Tu ne administratorius!");
  552. SendClientMessage(playerid, -1, "____________________________________________________________________");
  553. if(PlayerInfo[playerid][pAdmin] >= 1)
  554. {
  555. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 1: Komandų nėra!");
  556. }
  557. if(PlayerInfo[playerid][pAdmin] >= 2)
  558. {
  559. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 2: Komandų nėra!");
  560. }
  561. if(PlayerInfo[playerid][pAdmin] >= 3)
  562. {
  563. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 3: Komandų nėra!");
  564. }
  565. if(PlayerInfo[playerid][pAdmin] >= 4)
  566. {
  567. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 4: Komandų nėra!");
  568. }
  569. if(PlayerInfo[playerid][pAdmin] >= 5)
  570. {
  571. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 5: Komandų nėra!");
  572. }
  573. if(PlayerInfo[playerid][pAdmin] >= 6)
  574. {
  575. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 6: Komandų nėra!");
  576. }
  577. if(PlayerInfo[playerid][pAdmin] >= 7)
  578. {
  579. SendClientMessage(playerid, COLOR_FADE, "Admin statusas 7: /duotieuru -");
  580. }
  581. SendClientMessage(playerid, -1, "____________________________________________________________________");
  582. return 1;
  583. }
  584.  
  585. CMD:help(playerid, params[])
  586. {
  587. SendClientMessage(playerid, COLOR_LIGHTBLUE,"------------------------------------------------------------");
  588. SendClientMessage(playerid, COLOR_GRAD2,"/do - /me - /akcentas - /ocl - /b");
  589. SendClientMessage(playerid, COLOR_LIGHTBLUE,"------------------------------------------------------------");
  590. return 1;
  591. }
  592.  
  593. ALTCOMMAND:o->ooc;
  594. CMD:ooc(playerid, params[])
  595. {
  596. new
  597. string[ 186 ]
  598. ;
  599. if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "OCL chat'as uždarytas administratoriaus!");
  600. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "Naudojimas: {FFFFFF} /ocl [ocl chatas]");
  601.  
  602. format(string, sizeof(string), "(( OCL: %s: %s ))", RPName(playerid), params);
  603. OOCOff(0xCCFFFF00, string);
  604. printf("%s", string);
  605. return 1;
  606. }
  607.  
  608. CMD:b(playerid, params[])
  609. {
  610. new
  611. string[ 128 ]
  612. ;
  613. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "Naudojimas: {FFFFFF} /b [tekstas]");
  614. format(string, sizeof(string), "(( OOC: %s[%i]: %s ))", RPName( playerid ), playerid, params);
  615. printf("%s", string);
  616. ProxDetector(30.0, playerid, string, COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE);
  617. return 1;
  618. }
  619.  
  620. CMD:do(playerid, params[])
  621. {
  622. new
  623. result[ 128 ],
  624. string[ 128 ]
  625. ;
  626. if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "Naudojimas: {FFFFFF}/do [veiksmas]");
  627. format(string, sizeof(string), "* %s (( %s ))", result, RPName(playerid));
  628. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  629. printf("%s", string);
  630. return 1;
  631. }
  632.  
  633. CMD:me(playerid, params[])
  634. {
  635. new
  636. result[ 128 ],
  637. string[ 128 ]
  638. ;
  639. if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "Naudojimas: {FFFFFF}/do [veiksmas]");
  640. format(string, sizeof(string), "* %s %s", RPName(playerid), result);
  641. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  642. printf("%s", string);
  643. return 1;
  644. }
  645.  
  646. CMD:akcentas(playerid, params[])
  647. {
  648. if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, "Naudojimas: {FFFFFF}/accent [Lietuviškas | Rusiškas | Vokiškas| Britiškas]");
  649. if(!strcmp(params,"lietuviškas",true))
  650. {
  651. PlayerInfo[playerid][pAccent] = 1;
  652. SendClientMessage(playerid, COLOR_GRAD1, "Tavo akcentas dabar lietuviškas!");
  653. }
  654. else if(!strcmp(params,"rusiškas",true))
  655. {
  656. PlayerInfo[playerid][pAccent] = 2;
  657. SendClientMessage(playerid, COLOR_GRAD1, "Tavo akcentas dabar rusiškas!");
  658. }
  659. else if(!strcmp(params,"vokiškas",true))
  660. {
  661. PlayerInfo[playerid][pAccent] = 3;
  662. SendClientMessage(playerid, COLOR_GRAD1, "Tavo akcentas dabar vokiškas!");
  663. }
  664. else if(!strcmp(params,"britiškas",true))
  665. {
  666. PlayerInfo[playerid][pAccent] = 4;
  667. SendClientMessage(playerid, COLOR_GRAD1, "Tavo akcentas dabar britiškas!");
  668. }
  669.  
  670. else return SendClientMessage(playerid, COLOR_GREY, "nėra tokio akcento!");
  671. return 1;
  672. }
  673.  
  674. CMD:duotieuru(playerid, params[])
  675. {
  676. new targetid,type,string[128];
  677. if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "Naudojimas: {FFFFFF}/duotieuru [žaidėjo vardas/id] [SUMA]");
  678. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* žaidėjas atsijungęs arba blogai įvedete vardą..");
  679. if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* suma negali būti mažesne negu 0 ir didesne negu 99999999 .");
  680. if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GRAD1, "Tu ne administratorius!");
  681.  
  682. GivePlayerCash(targetid, type);
  683. format(string, sizeof(string),"Administratorius: %s davė žaidėjui %s %d pinigų", RPName( playerid ), RPName( targetid ), type);
  684. SendAdminMessage(COLOR_YELLOW,string);
  685. return 1;
  686. }
Advertisement
Add Comment
Please, Sign In to add comment