Advertisement
Rhisy

BLANK SCRIPT ROLEPLAY

Sep 14th, 2012
1,262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.06 KB | None | 0 0
  1. /*BLANK SCRIPT FROM http://forum.sa-mp.com*/
  2.  
  3. /*CREDITS:Y_LESS for y_ini,y_commands and sscanf
  4. Dracoblue: for udb_hash
  5. [R]hisy:Scripter GAMEMODE
  6. */
  7. #include <a_samp>
  8. #include <YSI\y_ini>
  9. #include <YSI\y_commands>
  10. #include <sscanf2>
  11.  
  12. //========[Path]===============//
  13. #define PATH "/Users/%s.ini"//
  14. //===================Dialogs===================
  15. #define Register 0
  16. #define Login 1
  17. #define SSex 2
  18. #define Sage 3
  19. #define SOrigin 4
  20. //==================Colors====================//
  21. #define TEAM_CYAN_COLOR 0xFF8282AA
  22. #define COLOR_FADE 0xE6E6E6E6
  23. #define ORANGE 0xFEAA00FF
  24. #define COLOR_GRAD1 0xB4B5B7FF
  25. #define COLOR_GREY                   0xAFAFAFAA
  26. #define RED_WIT      0xFF6347AA
  27. #define COLOR_GRAD5 0xE3E3E3FF
  28. #define COLOR_GRAD4 0xD8D8D8FF
  29. #define BLUE_CL 0x33CCFFAA
  30. #define COLOR_RADIOFACTION 0x9B9BFFFF // Blue
  31. #define DORAD   0xF6C861AA
  32. #define COLOR_GRAD2 0xBFC0C2FF
  33. #define COLOR_FADE1 0xE6E6E6E6
  34. #define COLOR_FADE2 0xC8C8C8C8
  35. #define COLOR_GRAD2 0xBFC0C2FF
  36. #define COLOR_FADE3 0xAAAAAAAA
  37. #define COLOR_FADE4 0x8C8C8C8C
  38. #define COLOR_FADE5 0x6E6E6E6E
  39. #define COLOR_PURPLE 0x9B009AA0
  40. #define COLOR_WHITE 0xFFFFFFAA
  41. #define BLUE 0x0000FFFF
  42. #define YELLOW 0xFFFF00FF
  43. #define RED 0xFF0000FF
  44. #define GREEN 0x00FF00FF
  45. #define WHITE 0xFFFFFFFF
  46. #define BLACK 0x000000FF
  47. #define WHITE_BLACK 0xAFAFAFAA
  48. #define TALK 0xE6E6E6E6
  49. #define TALK2 0xC8C8C8C8
  50. #define TALK3 0xAAAAAAAA
  51. #define TALK4 0x8C8C8C8C
  52. #define TALK5 0x6E6E6E6E
  53. #define Hospital 1178.4025,-1323.0923,14.1183//coordinates for hospital
  54. #pragma tabsize 0 //elimitated warning! "loose identification"
  55. new PTuto[MAX_PLAYERS];
  56. new PuedeP[MAX_PLAYERS];
  57. new EnTuto[MAX_PLAYERS];
  58. forward Tuto(playerid);
  59. //=====[Forwards y news]========//
  60. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);//proxdetector
  61. new Logued[MAX_PLAYERS];
  62. new BigEar[MAX_PLAYERS];
  63. new bool:Dead[MAX_PLAYERS];
  64. enum Info
  65. {
  66. pPassword,
  67. pTutorial,
  68. pMoney,
  69. pAdmin,
  70. pSex,
  71. pAge,
  72. pOrigin,
  73. pFaction
  74. };
  75. new PlayerInformation[MAX_PLAYERS][Info];
  76.  
  77. //======[Stocks]=============//
  78. stock UserPath(playerid)
  79. {
  80.     new string[128],playername[MAX_PLAYER_NAME];
  81.     GetPlayerName(playerid,playername,sizeof(playername));
  82.     format(string,sizeof(string),PATH,playername);
  83.     return string;
  84. }
  85.  
  86. /*Credits to Dracoblue*/
  87. stock udb_hash(buf[]) {
  88.     new length=strlen(buf);
  89.     new s1 = 1;
  90.     new s2 = 0;
  91.     new n;
  92.     for (n=0; n<length; n++)
  93.     {
  94.        s1 = (s1 + buf[n]) % 65521;
  95.        s2 = (s2 + s1)     % 65521;
  96.     }
  97.     return (s2 << 16) + s1;
  98. }
  99.  
  100. //=========================[Callbacks]====================================//
  101. forward LoadUser_data(playerid,name[],value[]);
  102. public LoadUser_data(playerid,name[],value[])
  103. {
  104. INI_Int("Password",PlayerInformation[playerid][pPassword]);
  105. INI_Int("Money",PlayerInformation[playerid][pMoney]);
  106. INI_Int("Tutorial",PlayerInformation[playerid][pTutorial]);
  107. INI_Int("Admin",PlayerInformation[playerid][pAdmin]);
  108. INI_Int("Sex",PlayerInformation[playerid][pSex]);
  109. INI_Int("Age",PlayerInformation[playerid][pAge]);
  110. INI_Int("Origin",PlayerInformation[playerid][pOrigin]);
  111. INI_Int("Faction",PlayerInformation[playerid][pFaction]);
  112. return 1;
  113. }
  114.  
  115. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  116. {
  117. switch(dialogid){
  118. //==[Register age]==//
  119. case Sage:
  120. {
  121. if(response)
  122. {
  123. switch(listitem){
  124. case 0:
  125. {
  126. PlayerInformation[playerid][pAge] = 16;
  127. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  128. }
  129. case 1:
  130. {
  131. PlayerInformation[playerid][pAge] = 17;
  132. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  133. }
  134. case 2:
  135. {
  136. PlayerInformation[playerid][pAge] = 18;
  137. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  138. }
  139. case 3:
  140. {
  141. PlayerInformation[playerid][pAge] = 19;
  142. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  143. }
  144. case 4:
  145. {
  146. PlayerInformation[playerid][pAge] = 20;
  147. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  148. }
  149. case 5:
  150. {
  151. PlayerInformation[playerid][pAge] = 21;
  152. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  153. }
  154. case 6:
  155. {
  156. PlayerInformation[playerid][pAge] = 22;
  157. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  158. }
  159. case 7:
  160. {
  161. PlayerInformation[playerid][pAge] = 23;
  162. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  163. }
  164. case 8:
  165. {
  166. PlayerInformation[playerid][pAge] = 24;
  167. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  168. }
  169. case 9:
  170. {
  171. PlayerInformation[playerid][pAge] = 25;
  172. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  173. }
  174. case 10:
  175. {
  176. PlayerInformation[playerid][pAge] = 26;
  177. ShowPlayerDialog(playerid, SOrigin, DIALOG_STYLE_LIST, "{FFFFFF}Select you Origin", "Argentina\nEspaña\nChile\nColombia\nVenezuela\nParaguay\nUruguay\nMexico\nEl Salvador\nBrazil\nPeru", "Select", "");
  178. }
  179. }
  180. }
  181. return 1;
  182. }
  183. //
  184. //====[Dialog Origin]====//
  185. case SOrigin:
  186. {
  187. if(response)
  188. {
  189. switch(listitem){
  190. case 0:
  191. {
  192. PlayerInformation[playerid][pOrigin] = 1;
  193. GameTextForPlayer(playerid, "~w~You were born in ~R~Argentina", 5000, 3);
  194. }
  195. case 1:
  196. {
  197. PlayerInformation[playerid][pOrigin] = 2;
  198. GameTextForPlayer(playerid, "~w~You were born in ~R~España", 5000, 3);
  199. }
  200. case 2:
  201. {
  202. PlayerInformation[playerid][pOrigin] = 3;
  203. GameTextForPlayer(playerid, "~w~You were born in ~R~Chile", 5000, 3);
  204. }
  205. case 3:
  206. {
  207. PlayerInformation[playerid][pOrigin] = 4;
  208. GameTextForPlayer(playerid, "~w~You were born in ~R~Colombia", 5000, 3);
  209. }
  210. case 4:
  211. {
  212. PlayerInformation[playerid][pOrigin] = 5;
  213. GameTextForPlayer(playerid, "~w~You were born in ~R~Venezuela", 5000, 3);
  214. }
  215. case 5:
  216. {
  217. PlayerInformation[playerid][pOrigin] = 6;
  218. GameTextForPlayer(playerid, "~w~You were born in ~R~Paraguay", 5000, 3);
  219. }
  220. case 6:
  221. {
  222. PlayerInformation[playerid][pOrigin] = 7;
  223. GameTextForPlayer(playerid, "~w~You were born in ~R~Uruguay", 5000, 3);
  224. }
  225. case 7:
  226. {
  227. PlayerInformation[playerid][pOrigin] = 8;
  228. GameTextForPlayer(playerid, "~w~You were born in ~R~Mexico", 5000, 3);
  229. }
  230. case 8:
  231. {
  232. PlayerInformation[playerid][pOrigin] = 9;
  233. GameTextForPlayer(playerid, "~w~You were born in ~R~El salvador", 5000, 3);
  234. }
  235. case 9:
  236. {
  237. PlayerInformation[playerid][pOrigin] = 10;
  238. GameTextForPlayer(playerid, "~w~You were born in ~R~Brasil", 5000, 3);
  239. }
  240. case 10:
  241. {
  242. PlayerInformation[playerid][pOrigin] = 11;
  243. GameTextForPlayer(playerid, "~w~You were born in ~R~Peru", 5000, 3);
  244. }
  245. }
  246. }
  247. SendClientMessage(playerid,-1," Home");
  248. SendClientMessage(playerid,-1,"Welcome to blank script");
  249. SendClientMessage(playerid,-1,"Please read the tutorial");
  250. SendClientMessage(playerid,-1,"Press enter please!");
  251. PTuto[playerid] = 1;
  252. return 1;
  253. }
  254.  
  255. case Register:
  256. {
  257. if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "{00FF00}Role Play ", "{FFFFFF}Please,Enter Password from account", "Register", "Exit");
  258. new INI:File = INI_Open(UserPath(playerid));
  259. INI_SetTag(File,"data");
  260. INI_WriteInt(File,"Password",udb_hash(inputtext));
  261. INI_WriteInt(File,"Money",0);
  262. INI_WriteInt(File,"Tutorial",0);
  263. INI_WriteInt(File,"Admin",0);
  264. INI_WriteInt(File,"Sex",0);
  265. INI_WriteInt(File,"Age",0);
  266. INI_WriteInt(File,"Origin",0);
  267. INI_WriteInt(File,"Faction",0);
  268. INI_Close(File);
  269. if (!response) return Kick(playerid);//Click in exit kick it
  270. Logued[playerid] = 1;
  271. SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
  272. SpawnPlayer(playerid);
  273. }
  274. case Login:
  275. {
  276. if ( !response ) return Kick ( playerid );
  277. if( response )
  278. {
  279. if(udb_hash(inputtext) == PlayerInformation[playerid][pPassword])
  280. {
  281. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);//Load user path
  282. GivePlayerMoney(playerid, PlayerInformation[playerid][pMoney]);
  283. Logued[playerid] = 1;
  284. SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
  285. SpawnPlayer(playerid);
  286. }
  287. else
  288. {
  289. ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "{FFFFFF}Role Play {FFFFFF}|", "{FF0000}You password is incorrect you kicked!!", "Acept", "");
  290. }
  291. return 1;
  292. }
  293. }
  294. }
  295. return 1;
  296. }
  297.  
  298. public OnPlayerConnect(playerid)
  299. { //reset player variables
  300. Logued[playerid] = 0;
  301. BigEar[playerid] = 0;
  302. PlayerInformation[playerid][pTutorial] = 0;
  303. PlayerInformation[playerid][pMoney] = 0;
  304. PlayerInformation[playerid][pAdmin] = 0;
  305. PlayerInformation[playerid][pSex] = 0;
  306. PlayerInformation[playerid][pAge] = 0;
  307. PlayerInformation[playerid][pOrigin] = 0;
  308. PlayerInformation[playerid][pFaction] = 0;
  309. return 1;
  310. }
  311.  
  312.  
  313. public OnPlayerText(playerid, text[])
  314. {
  315. if(EnTuto[playerid] == 1)
  316. {
  317. SendClientMessage(playerid, -1,"{D30700}You silenced time of tutorial!.");
  318. return 0;
  319. }
  320. new string[100];//Maximun caracthers
  321. format(string, sizeof(string), "%s Says: %s",NamePlayerEx(playerid), text);
  322. ProxDetector(10.0, playerid, string,TALK,TALK2,TALK3,TALK4,TALK5);
  323. return 0;
  324. }
  325.  
  326. public OnPlayerDeath(playerid, killerid, reason)
  327. {
  328. Dead[playerid] = true;//active variable player is setpos from hospital!
  329. return 1;
  330. }
  331. public OnPlayerSpawn(playerid)
  332. {
  333. if(Logued[playerid] == 0) return SendClientMessage(playerid,-1,"Sorry!for play in this server  need login!!");//This is for evite bug
  334. if(PlayerInformation[playerid][pTutorial] == 0)
  335. {
  336. TogglePlayerControllable(playerid,0);
  337. ShowPlayerDialog(playerid,SSex,DIALOG_STYLE_MSGBOX,"{FFFFFF}Select your Sex please","{00FFCC}¿Yur sex.. is, MALE OR FEMALE?","MALE","FEMALE");
  338. return 1;
  339. }
  340. if(PlayerInformation[playerid][pFaction] == 1)
  341. {
  342. //funtions for spawn faction one!
  343. return 1;
  344. }
  345. else if(PlayerInformation[playerid][pFaction] == 2)
  346. {
  347. //funtions for spawn faction two!
  348. return 1;
  349. }
  350. if(Dead[playerid] == true)
  351. {
  352. SetPlayerPos(playerid,Hospital);
  353. GivePlayerMoney(playerid, -500);//-500 MONEY
  354. SendClientMessage(playerid,-1,"You dead.. we will not remember anything at the hospital , I charge $ 500");
  355. Dead[playerid] = false;
  356. return 1;
  357. }
  358. return 1;
  359. }
  360.  
  361. public OnPlayerRequestSpawn(playerid)// this is very important, if you get used to the button nothing happens spawn spawn no ..
  362. {
  363. return 0;//leave it at zero, changing one spawn button worked and created a bugging
  364. }
  365.  
  366. public OnGameModeInit()
  367. {
  368. SetGameModeText("Roleplay blank script");
  369. SendRconCommand("Samp server");
  370. SendRconCommand("Los santos");
  371. ManualVehicleEngineAndLights();
  372. ShowPlayerMarkers(0);//desactive markers
  373. DisableInteriorEnterExits();//deleted enter and exit whit gta sa
  374. return 1;
  375. }
  376.  
  377. //========================///
  378. public OnPlayerDisconnect(playerid,reason)
  379. {
  380. new INI:File = INI_Open(UserPath(playerid));
  381. INI_SetTag(File,"data");//This at tag
  382. INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
  383. INI_WriteInt(File,"Tutorial",PlayerInformation[playerid][pTutorial]);
  384. INI_WriteInt(File,"Admin",PlayerInformation[playerid][pAdmin]);
  385. INI_WriteInt(File,"Sex",PlayerInformation[playerid][pSex]);
  386. INI_WriteInt(File,"Age",PlayerInformation[playerid][pAge]);
  387. INI_WriteInt(File,"Origin",PlayerInformation[playerid][pOrigin]);
  388. INI_WriteInt(File,"Faction",PlayerInformation[playerid][pFaction]);
  389. INI_Close(File);
  390. return 1;
  391. }
  392.  
  393. public OnPlayerRequestClass(playerid, classid)
  394. {
  395. if(fexist(UserPath(playerid)))
  396. {
  397. Logued[playerid] = 0;
  398. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);//
  399. ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "{009999}Login {FFFFFF}|", "{009999}Tipe your password for loguin in", "Conect", "Cancel");
  400. }
  401. else
  402. {
  403. ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, "{009999}Register {FFFFFF}| ", "{009999}Please select password from you account", "Register", "Cancel");
  404. }
  405. SetPlayerPos(playerid, 1809.1567,-1846.6804,39.8038);
  406. SetPlayerCameraPos(playerid, 1810.8529,-1844.0466,19.0966);
  407. SetPlayerCameraLookAt(playerid, 1810.8529,-1844.0466,19.0966);
  408. return 1;
  409. }
  410.  
  411. stock NamePlayerEx(playerid)
  412. {
  413. new Name[24];
  414. GetPlayerName(playerid,Name,24);
  415. new N[24];
  416. strmid(N,Name,0,strlen(Name),24);
  417. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  418. {
  419. if (N [i] == '_') N[i] = ' ';
  420. }
  421. return N;
  422. }
  423. ///////
  424. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  425. {
  426. if(PTuto[playerid] >= 1)
  427. {
  428. if(newkeys == KEY_SECONDARY_ATTACK)
  429. {
  430. if(PuedeP[playerid] == 1)
  431. {
  432. SendClientMessage(playerid, -1,"{D30700}Sorry 10 seconds please for new concept.");
  433. return 1;
  434. }
  435. Tuto(playerid);
  436. return 1;
  437. }
  438. return 1;
  439. }
  440. return 0;
  441. }
  442.  
  443. public Tuto(playerid)
  444. {
  445. switch(PTuto[playerid])
  446. {
  447. case 1:
  448. {
  449. SetPlayerInterior(playerid, 0);
  450. SetPlayerVirtualWorld(playerid, 0);
  451. EnTuto[playerid] = 1;
  452. PuedeP[playerid] = 1;
  453. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  454. SetPlayerPos(playerid, 1661.2817,-1496.6858,106.2865);
  455. SetPlayerCameraPos(playerid, 1661.2817,-1496.6858,106.2865);
  456. SetPlayerCameraLookAt(playerid,1598.6127,-1358.9615,100.0464);
  457. SendClientMessage(playerid, -1,"{D30700}One step the tutorial.");
  458. PTuto[playerid] ++;
  459. }
  460. case 2:
  461. {
  462. PuedeP[playerid] = 1;
  463. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  464. SendClientMessage(playerid, -1,"{D30700}Second step the tutorial.");
  465. PTuto[playerid] ++;
  466. }
  467. case 3:
  468. {
  469. PuedeP[playerid] = 1;
  470. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  471. InterpolateCameraPos(playerid, 1529.668701, -1676.500488, 18.162904, 1205.580200, -1323.094360, 20.972612, 3000);
  472. InterpolateCameraLookAt(playerid, 1534.656372, -1676.352539, 17.845149, 1200.686767, -1323.198364, 19.950950, 3000);
  473. SendClientMessage(playerid, -1,"{D30700}third step the tutorial.");
  474. PTuto[playerid] ++;
  475. }
  476. case 4:
  477. {
  478. PuedeP[playerid] = 1;
  479. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  480. SendClientMessage(playerid, -1,"{D30700}Four step the tutorial.");
  481. PTuto[playerid] ++;
  482. }
  483. case 5:
  484. {
  485. PuedeP[playerid] = 1;
  486. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  487. InterpolateCameraPos(playerid, 1820.795288, -1885.217041, 33.298183, 1480.225097, -1720.986450, 26.222684, 3000);
  488. InterpolateCameraLookAt(playerid, 1816.722534, -1887.284301, 31.263662, 1480.217895, -1725.824707, 24.961456, 3000);
  489. SendClientMessage(playerid, -1,"{D30700}Five step the tutorial.");
  490. PTuto[playerid] ++;
  491. }
  492. case 6:
  493. {
  494. SendClientMessage(playerid, -1,"{D30700}Finish step the tutorial.");
  495. PuedeP[playerid] = 1;
  496. SetTimerEx("PuedePTimer", 5000, 0, "d", playerid);
  497. PTuto[playerid] = 0;
  498. PlayerInformation[playerid][pTutorial] = 1;
  499. GivePlayerMoney(playerid, 1500);
  500. }
  501. }
  502. return 1;
  503. }
  504.  
  505. forward PuedePTimer(playerid);
  506. public PuedePTimer(playerid)
  507. {
  508. PuedeP[playerid] = 0;
  509. return 1;
  510. }
  511. ///////////
  512. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  513. {
  514. if(IsPlayerConnected(playerid))
  515. {
  516. new Float:posx, Float:posy, Float:posz;
  517. new Float:oldposx, Float:oldposy, Float:oldposz;
  518. new Float:tempposx, Float:tempposy, Float:tempposz;
  519. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  520. for(new i = 0; i < MAX_PLAYERS; i++)
  521. {
  522. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  523. {
  524. if(!BigEar[i])
  525. {
  526. GetPlayerPos(i, posx, posy, posz);
  527. tempposx = (oldposx -posx);
  528. tempposy = (oldposy -posy);
  529. tempposz = (oldposz -posz);
  530. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  531. {
  532. SendClientMessage(i, col1, string);
  533. }
  534. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  535. {
  536. SendClientMessage(i, col2, string);
  537. }
  538. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  539. {
  540. SendClientMessage(i, col3, string);
  541. }
  542. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  543. {
  544. SendClientMessage(i, col4, string);
  545. }
  546. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  547. {
  548. SendClientMessage(i, col5, string);
  549. }
  550. }
  551. else
  552. {
  553. SendClientMessage(i, col1, string);
  554. }
  555. }
  556. }
  557. }
  558. return 1;
  559. }
  560.  
  561. //=====[Comands]=========//
  562. //Comands for admin
  563. YCMD:makeleader(playerid, params[], help)
  564. {
  565. if (help) SendClientMessage(playerid, 0xFF0000AA, "MAKE LEADER");
  566. else
  567. {
  568. new ID,FACTION;
  569. if(PlayerInformation[playerid][pAdmin] < 4) return SendClientMessage(playerid,-1,"Not autorized!");
  570. if(sscanf(params, "ud", ID,FACTION) )return SendClientMessage(playerid,-1,"Uso: /makeleader [ID] [Facc]");
  571. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Player offline/ID incorrect");
  572. {
  573. PlayerInformation[ID][pFaction] = FACTION;
  574. return 1;
  575. }
  576. }
  577. return 1;
  578. }
  579.  
  580. YCMD:makeadmin(playerid, params[], help)
  581. {
  582. if (help) SendClientMessage(playerid, 0xFF0000AA, "MAKEADMIN");
  583. else
  584. {
  585. new ID,ADMIN;
  586. if(PlayerInformation[playerid][pAdmin] < 10) return SendClientMessage(playerid,-1,"Not autorized!");
  587. if(sscanf(params, "ud", ID,ADMIN) )return SendClientMessage(playerid,-1,"Uso: /makeadmin [ID] [ADMLEVEL]");
  588. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Player offline/ID incorrect");
  589. {
  590. PlayerInformation[ID][pAdmin] = ADMIN;
  591. return 1;
  592. }
  593. }
  594. return 1;
  595. }
  596.  
  597. YCMD:givemoney(playerid, params[], help)
  598. {
  599. if (help) SendClientMessage(playerid, 0xFF0000AA, "GIVEMONEY");
  600. else
  601. {
  602. new ID,PLATA;
  603. if(PlayerInformation[playerid][pAdmin] < 10) return SendClientMessage(playerid,-1,"Not autorized!");
  604. if(sscanf(params, "ud", ID,PLATA) )return SendClientMessage(playerid,-1,"Uso: /givemoney [ID] [Money]");
  605. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Player offline/ID incorrect");
  606. {
  607. PlayerInformation[ID][pMoney] = PLATA;
  608. GivePlayerMoney(ID,PLATA);
  609. return 1;
  610. }
  611. }
  612. return 1;
  613. }
  614. //=========[Canal /me]=========//
  615. YCMD:me(playerid, params[], help)
  616. {
  617. if (help) SendClientMessage(playerid, 0xFF0000AA, "ROLEPLAY ME BASIC ");
  618. else
  619. {
  620. if(!sscanf(params, "s[128]", params[0]))
  621. {
  622. new string[128];
  623. format(string, sizeof(string), "* %s %s.", NamePlayerEx(playerid), params[0]);
  624. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); }
  625. else SendClientMessage(playerid, COLOR_GRAD2, "USE: /me <Actión>");
  626. }
  627. return 1;
  628. }
  629. //======[Canal /do]============//
  630. YCMD:do(playerid, params[], help)
  631. {
  632. if (help) SendClientMessage(playerid, 0xFF0000AA, "DO BASIC ROLEPLAY ");
  633. else
  634. {
  635. if(!sscanf(params, "s[128]", params[0]))
  636. {
  637. new string[128];
  638. format(string, sizeof(string), "* %s (( %s )).", NamePlayerEx(playerid), params[0]);
  639. ProxDetector(30.0, playerid, string, 0xB6DB22FF,0xB6DB22FF,0xB6DB22FF,0xB6DB22FF,0xB6DB22FF);
  640. } else SendClientMessage(playerid, COLOR_GRAD2, "USE: /do <Actión>");
  641. }
  642. return 1;
  643. }
  644. //=======[WHISP /G]===========//
  645. YCMD:g(playerid, params[], help)
  646. {
  647. if (help) SendClientMessage(playerid, 0xFF0000AA, "whisp ");
  648. else
  649. {
  650. if(!sscanf(params, "s[128]", params[0]))
  651. {
  652. new string[128];
  653. format(string, sizeof(string), "%s whisp: ¡¡ %s !!", NamePlayerEx(playerid), params[0]);
  654. ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
  655. } else SendClientMessage(playerid, COLOR_GRAD2, "USE: /g FOR WISP");
  656. }
  657. return 1;
  658. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement