Guest User

Untitled

a guest
Apr 17th, 2012
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.65 KB | None | 0 0
  1. // Ganz unten ist eine Anleitung wie man neue Rooms erstellt
  2. /*
  3. ################################################################################
  4. ################################################################################
  5. ################################################################################
  6. ################################################################################
  7. ################################################################################
  8. ################################################################################
  9. ################################################################################
  10. ################################################################################
  11. ################################################################################
  12. ################################################################################
  13. ################################################################################
  14. ############# ################################ ######## ####################
  15. ############ #### ## # # f# ## #L ### # #. #############
  16. ############ # ## # # #W # # # ; # f# # ### # # # ##############
  17. ############ ## # # # # ## # ### # # j # f# # ###### # #L ##############
  18. ############# # # # ## # # # # ## ## ### ## ###############
  19. ################################################################ ###############
  20. ################################################################################
  21. ################################################################################
  22. ######## # ######################### ### ########### ##L ######## #######
  23. ######### #####L.####.#####:,#### ###. ### #W #K G##W ## # ##t,### #######
  24. ######### ## # # # . ### #K # . # # ### #K #K# :: # # # # f# # # #######
  25. ######### ## # ## # ## ### # ## # # ### ## # # # # # ## # # #######
  26. ######### ## # G # ## ### i # ## # W ### #### # Gf # ### # , # D #######
  27. ################################################################################
  28. ################################################################################
  29. ################################################################################
  30. ################################################################################
  31. ################################################################################
  32. Gamemode by Tion and PasMod
  33. */
  34.  
  35. #include <a_samp>
  36. #include <ocmd>
  37. #include <sscanf2>
  38. /*Farben*/
  39. #define Rot 0xEB0000FF
  40. #define Grun 0x23FF00FF
  41. #define Weiss 0xF0FFFFFF
  42.  
  43. new GetNamee[MAX_PLAYER_NAME];
  44. #define SERVERNAME "DEATHMATCHSERVER" //Server Name
  45. #define SERVEROWNER "MAX MUSTERMANN" // "MAX MUSTERMANN" in euren Namen eintauschen
  46. #define NORMALUSER "Roombefehle:\n\n-\t/exit\n-\t/users\n-\t/scores\n\nChatbefehle:\n\n-\t/chat\n\nSonstiges:\n\n-\t/credits"
  47. #define ADMINUSER "Adminbefehle:\n\n-\t/adminbefehle\n\nRoombefehle:\n\n-\t/exit\n-\t/users\n-\t/scores\n\nChatbefehle:\n\n-\t/chat\n\nSonstiges:\n\n-\t/credits"
  48.  
  49. #define COLOR_RED 0xFF6347AA
  50. #define COLOR_BLUE 0x33CCFFAA
  51. #define COLOR_GREEN 0x9ACD32AA
  52. #define COLOR_YELLOW 0xFFFF00AA
  53. #define COLOR_GREY 0xAFAFAFAA
  54. #define HELP (0)
  55.  
  56. new playerroom[MAX_PLAYERS];
  57. new playerkills[MAX_PLAYERS];
  58. new playerdeaths[MAX_PLAYERS];
  59. new Float:playerspawns[MAX_PLAYERS][3];
  60. enum Info
  61. {
  62. adminlevel,
  63. }
  64. new PlayerInfo[MAX_PLAYERS][Info];
  65. main()
  66. {
  67. print(" ");
  68. print(" ");
  69. print(" ");
  70. print("+-----------------------------------------+");
  71. print("| FREE DM by Tion 1.0.0| by PasMod 1.0.1| ");
  72. print("+-----------------------------------------+");
  73. print("|");
  74. print("+ http://Streets-of-SA.de/");
  75. print(" ");
  76. print(" ");
  77. print(" ");
  78. }
  79.  
  80. public OnGameModeInit()
  81. {
  82. AddPlayerClass(0, 2737.7942, -1760.0331, 44.1401 ,299.8479, 0, 0, 0, 0, 0, 0);
  83. return 1;
  84. }
  85.  
  86. public OnGameModeExit()
  87. {
  88. SendClientMessageToAll(COLOR_GREY, "* Der Server wurde heruntergefahren, alle werden gekickt");
  89. for(new i = 0; i < MAX_PLAYERS; i++)
  90. {
  91. if(IsPlayerConnected(i)) Kick(i);
  92. }
  93. return 1;
  94. }
  95.  
  96. public OnPlayerConnect(playerid)
  97. {
  98. playerroom[playerid] = 0;
  99. playerkills[playerid] = 0;
  100. playerdeaths[playerid] = 0;
  101. new PlayerName[MAX_PLAYER_NAME];
  102. new string[128];
  103. GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  104. format(string, sizeof(string), "*%s betritt den Server", PlayerName);
  105. SendClientMessageToAll(COLOR_GREY, string);
  106. SendClientMessage(playerid, COLOR_GREY, " ");
  107. SendClientMessage(playerid, COLOR_GREY, " ");
  108. SendClientMessage(playerid, COLOR_GREY, " ");
  109. SendClientMessage(playerid, COLOR_YELLOW, "Wilkommen auf "SERVERNAME"");
  110. SendClientMessage(playerid, COLOR_YELLOW, "Du kannst nun spawnen und dir dann einen Room aussuchen");
  111. SendClientMessage(playerid, COLOR_YELLOW, "Zum Spawnen klicke einfach unten auf den Balken mit den Pfeilen");
  112. SendClientMessage(playerid, COLOR_YELLOW, "auf die Schaltfläche \"Spawn\"...");
  113. SendClientMessage(playerid, COLOR_GREY, " ");
  114. SendClientMessage(playerid, COLOR_GREY, " ");
  115. // Hier nix hin wegen dem "Connected to SAMP 03c Server"
  116. SpawnPlayer(playerid);
  117. return 1;
  118. }
  119.  
  120. public OnPlayerDisconnect(playerid, reason)
  121. {
  122. new PlayerName[MAX_PLAYER_NAME];
  123. new string[128];
  124. GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  125. format(string, sizeof(string), "*%s verlässt den Server", PlayerName);
  126. SendClientMessageToAll(COLOR_GREY, string);
  127. return 1;
  128. }
  129.  
  130. public OnPlayerDeath(playerid, killerid, reason)
  131. {
  132. new playername[256];
  133. GetPlayerName(playerid, playername, sizeof(playername));
  134. new killername[256];
  135. GetPlayerName(killerid, killername, sizeof(killername));
  136. new string[256];
  137. if(killerid != 255 && playerroom[playerid] != 0)
  138. {
  139. format(string, sizeof(string), "* Du tötest %s , + 1 Kill", playername);
  140. SendClientMessage(killerid, COLOR_GREEN, string);
  141. format(string, sizeof(string), "* Du wurdest von %s , + 1 Death", killername);
  142. SendClientMessage(playerid, COLOR_RED, string);
  143. playerkills[killerid]++;
  144. playerdeaths[playerid]++;
  145. }
  146. else if(playerroom[playerid] != 0)
  147. {
  148. SendClientMessage(playerid, COLOR_RED, "* Du bist gestorben - + 1 Death");
  149. playerdeaths[playerid]++;
  150. }
  151. else
  152. {
  153. SendClientMessage(playerid, COLOR_YELLOW, "* Bitte wähle nun deinen neuen Raum");
  154. }
  155. return 1;
  156. }
  157.  
  158. public OnPlayerSpawn(playerid)
  159. {
  160. if(playerroom[playerid] == 0)
  161. {
  162. SetPlayerPos(playerid, 2737.7942, -1760.0331, 44.1401);
  163. SetPlayerWorldBounds(playerid, 2836.069, 2619.307, -1654.228, -1883.197);
  164. /* Hier neue Rooms rein
  165. jeden Room mit einem "\n" ( für eine neue Zeile ) trennen... */
  166. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Bitte wähle einen Room", "Grove Street [ ZUFUSS / UZI ]\nAirport LS [ ZUFUSS / MINIGUN ]", "Wählen", "");
  167. }
  168. else
  169. {
  170. SetPlayerPos(playerid, playerspawns[playerid][0], playerspawns[playerid][1], playerspawns[playerid][2]);
  171. }
  172. return 1;
  173. }
  174.  
  175. public OnPlayerText(playerid, text[])
  176. {
  177. SendClientMessage(playerid, COLOR_YELLOW, " ");
  178. SendClientMessage(playerid, COLOR_YELLOW, " ");
  179. SendClientMessage(playerid, COLOR_YELLOW, " ");
  180. SendClientMessage(playerid, COLOR_YELLOW, "Chatmöglichkeiten:");
  181. SendClientMessage(playerid, COLOR_YELLOW, " Umgebungschat ( U ): /chat und dann \"Umgebungschat\"");
  182. SendClientMessage(playerid, COLOR_YELLOW, " Roomchat ( R ): /chat und dann \"Roomchat\"");
  183. SendClientMessage(playerid, COLOR_YELLOW, " Generalchat ( G ): /chat und dann \"Generalchat\"");
  184. SendClientMessage(playerid, COLOR_YELLOW, " ");
  185. SendClientMessage(playerid, COLOR_YELLOW, " ");
  186. SendClientMessage(playerid, COLOR_YELLOW, " ");
  187. return 0;
  188. }
  189. ocmd:help(playerid, params[])
  190. {
  191. if(IsPlayerAdmin(playerid))
  192. {
  193. ShowPlayerDialog(playerid,HELP,DIALOG_STYLE_MSGBOX,"Hilfe",ADMINUSER,"Close","");
  194. }
  195. ShowPlayerDialog(playerid,HELP,DIALOG_STYLE_MSGBOX,"Hilfe",NORMALUSER,"Close","");
  196. return 1;
  197. }
  198. ocmd:exit(playerid,params[])
  199. {
  200. playerroom[playerid] = 0;
  201. SendClientMessage(playerid, COLOR_YELLOW, " Bitte warte kurz...");
  202. SendClientMessage(playerid, COLOR_YELLOW, " Du wirst nun getötet, dir wird jedoch kein Death zugerechnet");
  203. SetPlayerHealth(playerid, 0);
  204. return 1;
  205. }
  206. ocmd:users(playerid, parama[])
  207. {
  208. if(IsPlayerConnected(playerid))
  209. {
  210. new giveplayername[MAX_PLAYERS];
  211. new count;
  212. SendClientMessage(playerid, COLOR_YELLOW, "Spieler in deinem Room:");
  213. for(new i = 0; i < MAX_PLAYERS; i++)
  214. {
  215. if(IsPlayerConnected(i))
  216. {
  217. if(playerroom[i] == playerroom[playerid])
  218. {
  219. GetPlayerName(i, giveplayername, sizeof(giveplayername));
  220. SendClientMessage(playerid, COLOR_GREEN, giveplayername);
  221. count++;
  222. }
  223. }
  224. }
  225. if(count == 0) { SendClientMessage(playerid, COLOR_RED, "* Du bist der einzige in diesem Room"); }
  226. if(count >= 10) { SendClientMessage(playerid, COLOR_RED, "* Benutze die \"Bild up\" bzw. \"Bild down\" Tasten um zu blättern"); }
  227. return 1;
  228. }
  229. return 1;
  230. }
  231. ocmd:scores(playerid, params[])
  232. {
  233. if(IsPlayerConnected(playerid))
  234. {
  235. new giveplayername[MAX_PLAYERS];
  236. new count;
  237. new besterid; new besterscore;
  238. new schlechterid; new schlechterscore;
  239. for(new i = 0; i < MAX_PLAYERS; i++)
  240. {
  241. if(IsPlayerConnected(i))
  242. {
  243. if(playerroom[i] == playerroom[playerid])
  244. {
  245. if(playerkills[i] > besterscore) { besterid = i; besterscore = playerkills[i]; }
  246. if(playerdeaths[i] > schlechterscore) { schlechterid = i; schlechterscore = playerdeaths[i]; }
  247. count++;
  248. }
  249. }
  250. }
  251. if(count == 0)
  252. {
  253. SendClientMessage(playerid, COLOR_RED, "* Du bist der einzige in diesem Room !");
  254. }
  255. else
  256. {
  257. SendClientMessage(playerid, COLOR_YELLOW, " Am meisten getötet hat:");
  258. GetPlayerName(besterid, giveplayername, sizeof(giveplayername));
  259. format(giveplayername, sizeof(giveplayername), "%s ( %d Kills )", giveplayername, besterscore);
  260. SendClientMessage(playerid, COLOR_YELLOW, giveplayername);
  261. SendClientMessage(playerid, COLOR_YELLOW, " Am meisten gestorben ist:");
  262. GetPlayerName(schlechterid, giveplayername, sizeof(giveplayername));
  263. format(giveplayername, sizeof(giveplayername), "%s ( %d Deaths )", giveplayername, schlechterscore);
  264. SendClientMessage(playerid, COLOR_YELLOW, giveplayername);
  265. }
  266. return 1;
  267. }
  268. return 1;
  269. }
  270. ocmd:chat(playerid, params[])
  271. {
  272. if(IsPlayerConnected(playerid))
  273. {
  274. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Bitte wähle die Chatlocation", "In meinem Umkreis sichtbar\nIn meinem Room sichtbar\nFür alle sichtbar", "OK", "Abbrechen");
  275. }
  276. return 1;
  277. }
  278. ocmd:makeadmin(playerid, params[])
  279. {
  280. if(IsPlayerAdmin(playerid)){
  281. new pID, Level, string[60];
  282. if(sscanf(params, "dd", pID, Level)) return SendClientMessage(playerid, Rot, "Benutze: /makeadmin [Playerid] [Level]");
  283. format(string, sizeof(string), " %s {4D8CE3}wurde zum Admin ernannt, Level: {FF0000}%d", getName(pID), Level);
  284. SendClientMessage(playerid, Rot, string);
  285. PlayerInfo[playerid][adminlevel] = Level;}
  286. return 1;
  287. }
  288. ocmd:kick(playerid, params[])
  289. {
  290. if(PlayerInfo[playerid][adminlevel]){
  291. new pID, Grund[50];
  292. if(sscanf(params, "ds", pID, Grund)) return SendClientMessage(playerid, Rot, "Benutze: /kick [Playerid] [Grund]");
  293. Kick(pID);}
  294. return 1;
  295. }
  296. ocmd:ban(playerid, params[])
  297. {
  298. if(PlayerInfo[playerid][adminlevel]){
  299. new pID, Grund[50];
  300. if(sscanf(params, "ds", pID, Grund)) return SendClientMessage(playerid, Rot, "Benutze: /ban [Playerid] [Grund]");
  301. Ban(pID);}
  302. return 1;
  303. }
  304. public OnPlayerCommandText(playerid, cmdtext[])
  305. {
  306. if(strcmp(cmdtext, "/credits", true) == 0)
  307. {
  308. if(IsPlayerConnected(playerid))
  309. {
  310. SendClientMessage(playerid, COLOR_YELLOW, " ");
  311. SendClientMessage(playerid, COLOR_YELLOW, "(_.: Credits :._)");
  312. SendClientMessage(playerid, COLOR_YELLOW, " Grundscript:");
  313. SendClientMessage(playerid, COLOR_GREEN, " free-dm by Tion");
  314. SendClientMessage(playerid, COLOR_YELLOW, " erweitert von:");
  315. SendClientMessage(playerid, COLOR_GREEN, " PasMod ");
  316. SendClientMessage(playerid, COLOR_YELLOW, " Für den Server:");
  317. SendClientMessage(playerid, COLOR_GREEN, " "SERVERNAME" ");
  318. SendClientMessage(playerid, COLOR_YELLOW, " ");
  319. SendClientMessage(playerid, COLOR_YELLOW, " ");
  320. }
  321. return 1;
  322. }
  323. /***** ADMINSTRATIONSBEFEHLE *****/
  324. if(strcmp(cmdtext, "/adminbefehle", true) == 0)
  325. {
  326. if(IsPlayerConnected(playerid))
  327. {
  328. if(IsPlayerAdmin(playerid))
  329. {
  330. SendClientMessage(playerid, COLOR_YELLOW, " ");
  331. SendClientMessage(playerid, COLOR_YELLOW, " ");
  332. SendClientMessage(playerid, COLOR_GREEN, "(_.: Adminstrationsbefehle "SERVERNAME" :._)");
  333. SendClientMessage(playerid, COLOR_YELLOW, " /rcon login [ PASSWORT ]");
  334. SendClientMessage(playerid, COLOR_YELLOW, " /rcon kick [ NAME ]");
  335. SendClientMessage(playerid, COLOR_YELLOW, " /rcon ban [ NAME ]");
  336. SendClientMessage(playerid, COLOR_YELLOW, " /rcon gravity [ NEUE SCHWERKRAFT ]");
  337. if(PlayerInfo[playerid][adminlevel] >= 1)
  338. {
  339. SendClientMessage(playerid, COLOR_YELLOW, " /kick [ ID ] [ Grund ] ");
  340. SendClientMessage(playerid, COLOR_YELLOW, " /ban [ ID ] [ Grund ] ");
  341. }
  342. SendClientMessage(playerid, COLOR_YELLOW, " /makeadmin [ ID ] [ Level ]");
  343. SendClientMessage(playerid, COLOR_YELLOW, " ");
  344. }
  345. else
  346. {
  347. SendClientMessage(playerid, COLOR_YELLOW, "* Für diesen Befehl musst du ein RCON-Adminstrator sein");
  348. }
  349. }
  350. return 1;
  351. }
  352. else
  353. {
  354. SendClientMessage(playerid, COLOR_YELLOW, "* Unbekannter Befehl");
  355. SendClientMessage(playerid, COLOR_YELLOW, " Benutze /help für eine Liste aller Befehle");
  356. }
  357. return 1;
  358. }
  359.  
  360. public OnPlayerRequestSpawn(playerid)
  361. {
  362. return 1;
  363. }
  364.  
  365. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  366. {
  367. if(dialogid == 1) // Roomwahl
  368. {
  369. if(!response)
  370. {
  371. SendClientMessage(playerid, COLOR_RED, "* Bei uns musst du einen Room wählen");
  372. return 1;
  373. }
  374. SendClientMessage(playerid, COLOR_RED, "Benutze \"/exit\" um diesen Room zu verlassen");
  375. SetPlayerVirtualWorld(playerid, listitem); // Um die Locations mehrere male benutzen zu können
  376. playerroom[playerid] = listitem + 1;
  377. switch(listitem)
  378. {
  379. case 0: // Grove Street
  380. {
  381. GivePlayerWeapon(playerid, 28, 500);
  382. switch(random(10))
  383. {
  384. case 0: { playerspawns[playerid][0] = 2504.9829; playerspawns[playerid][1] = -1694.7018; playerspawns[playerid][2] = 17.9575; }
  385. case 1: { playerspawns[playerid][0] = 2490.7476; playerspawns[playerid][1] = -1695.7056; playerspawns[playerid][2] = 22.2326; }
  386. case 2: { playerspawns[playerid][0] = 2471.8508; playerspawns[playerid][1] = -1695.3878; playerspawns[playerid][2] = 13.5153; }
  387. case 3: { playerspawns[playerid][0] = 2452.4304; playerspawns[playerid][1] = -1682.1855; playerspawns[playerid][2] = 13.5066; }
  388. case 4: { playerspawns[playerid][0] = 2454.1157; playerspawns[playerid][1] = -1647.4116; playerspawns[playerid][2] = 13.4718; }
  389. case 5: { playerspawns[playerid][0] = 2463.1699; playerspawns[playerid][1] = -1647.2560; playerspawns[playerid][2] = 13.4668; }
  390. case 6: { playerspawns[playerid][0] = 2480.6689; playerspawns[playerid][1] = -1649.2880; playerspawns[playerid][2] = 13.4688; }
  391. case 7: { playerspawns[playerid][0] = 2498.8149; playerspawns[playerid][1] = -1642.4669; playerspawns[playerid][2] = 13.7826; }
  392. case 8: { playerspawns[playerid][0] = 2514.8372; playerspawns[playerid][1] = -1651.4110; playerspawns[playerid][2] = 14.3557; }
  393. case 9: { playerspawns[playerid][0] = 2524.1545; playerspawns[playerid][1] = -1664.0876; playerspawns[playerid][2] = 15.1382; }
  394. }
  395. SetPlayerWorldBounds(playerid, 2543.251, 2387.334, -1598.959, -1748.974);
  396. }
  397. case 1: // Airport LS
  398. {
  399. GivePlayerWeapon(playerid, 38, 999);
  400. switch(random(5))
  401. {
  402. case 0: { playerspawns[playerid][0] = 1959.9795; playerspawns[playerid][1] = -2350.6179; playerspawns[playerid][2] = 13.5469; }
  403. case 1: { playerspawns[playerid][0] = 1650.8014; playerspawns[playerid][1] = -2545.6108; playerspawns[playerid][2] = 13.5469; }
  404. case 2: { playerspawns[playerid][0] = 1524.6760; playerspawns[playerid][1] = -2394.8601; playerspawns[playerid][2] = 13.5547; }
  405. case 3: { playerspawns[playerid][0] = 1380.6987; playerspawns[playerid][1] = -2533.2346; playerspawns[playerid][2] = 17.2344; }
  406. case 4: { playerspawns[playerid][0] = 1380.1570; playerspawns[playerid][1] = -2538.1484; playerspawns[playerid][2] = 13.5469; }
  407. }
  408. SetPlayerWorldBounds(playerid, 2318.883, 1261.695, -2183.225, -2767.491);
  409. }
  410. /*
  411. case x: // Vorlage für neuen Room
  412. {
  413. GivePlayerWeapon(playerid, 38, 999); // In diesem Fall eine Minigun ( Waffenid 39 ) mit 999 Schuss
  414. switch(random(ZUFALLZAHL)) // Zufallszahl durch die spawnpunkte ersetzen
  415. {
  416. case 0: { playerspawns[playerid][0] = 0.0; playerspawns[playerid][1] = 0.0; playerspawns[playerid][2] = 0.0; }
  417. // case x: { playerspawns[playerid][0] = X-Pos; playerspawns[playerid][1] = Y-Pos; playerspawns[playerid][2] = Z-Pos; } // wiederholen bis b in der case anweisung ZUFALLSZAHL - 1 ist
  418. }
  419. SetPlayerWorldBounds(playerid, X1, Y1, X2, Y2);
  420. }
  421. */
  422. }
  423. SetPlayerPos(playerid, playerspawns[playerid][0], playerspawns[playerid][1], playerspawns[playerid][2]);
  424. }
  425. else if(dialogid == 2) // Chat
  426. {
  427. if(!response) { return 1; }
  428. switch(listitem)
  429. {
  430. case 0: // Umgebung
  431. {
  432. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "In meiner Umgebung etwas sagen", "Bitte gebe hier den Text ein, den du in der Umgebung anzeigen möchtest", "Sagen", "Doch nicht");
  433. }
  434. case 1: // Room
  435. {
  436. ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "In meinem Room etwas sagen", "Bitte gebe hier den Text ein, den du in deinem Room anzeigen möchtest", "Sagen", "Doch nicht");
  437. }
  438. case 2: // General
  439. {
  440. ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "In dem Generalchat etwas sagen", "Bitte gebe hier den Text ein, den du in dem Generalchat anzeigen möchtest", "Sagen", "Doch nicht");
  441. }
  442. }
  443. }
  444. else if(dialogid == 3) // Umgebungschat
  445. {
  446. if(!response) { return 1; }
  447. new string[256];
  448. new playername[MAX_PLAYER_NAME];
  449. GetPlayerName(playerid, playername, sizeof(playername));
  450. new Float:x, Float:y, Float:z;
  451. GetPlayerPos(playerid, x, y, z);
  452. format(string, sizeof(string), "U: %s sagt: %s", playername, inputtext);
  453. for(new i = 0; i < MAX_PLAYERS; i++)
  454. {
  455. if(IsPlayerConnected(i))
  456. {
  457. if(PlayerToPoint(15, i, x, y, z))
  458. {
  459. SendClientMessage(i, COLOR_GREY, string);
  460. }
  461. }
  462. }
  463. }
  464. else if(dialogid == 4) // Roomchat
  465. {
  466. if(!response) { return 1; }
  467. new string[256];
  468. new playername[MAX_PLAYER_NAME];
  469. GetPlayerName(playerid, playername, sizeof(playername));
  470. format(string, sizeof(string), "R: %s sagt: %s", playername, inputtext);
  471. for(new i = 0; i < MAX_PLAYERS; i++)
  472. {
  473. if(IsPlayerConnected(i))
  474. {
  475. if(playerroom[i] == playerroom[playerid])
  476. {
  477. SendClientMessage(i, COLOR_GREY, string);
  478. }
  479. }
  480. }
  481. }
  482. else if(dialogid == 5) // Generalchat
  483. {
  484. if(!response) { return 1; }
  485. new string[256];
  486. new playername[MAX_PLAYER_NAME];
  487. GetPlayerName(playerid, playername, sizeof(playername));
  488. format(string, sizeof(string), "G: %s sagt: %s", playername, inputtext);
  489. SendClientMessageToAll(COLOR_GREY, string);
  490. }
  491. return 1;
  492. }
  493.  
  494. /***** PlayerToPoint by Unbekannt *****/
  495.  
  496. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  497.  
  498. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  499. {
  500. if(IsPlayerConnected(playerid))
  501. {
  502. new Float:oldposx, Float:oldposy, Float:oldposz;
  503. new Float:tempposx, Float:tempposy, Float:tempposz;
  504. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  505. tempposx = (oldposx -x);
  506. tempposy = (oldposy -y);
  507. tempposz = (oldposz -z);
  508. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  509. {
  510. return 1;
  511. }
  512. }
  513. return 0;
  514. }
  515.  
  516. /*
  517. ##########################################################################
  518. ##################### ANLEITUNG NEUE ROOMS ERSTELLEN #####################
  519. ##########################################################################
  520.  
  521. 1. Roomname ausdenken und ihn in den Dialog in Zeile 120 eintragen.
  522.  
  523. Hinweis:
  524.  
  525. Die Rooms müssen immer mit einem "\n" getrennt werden !
  526.  
  527. 2. Den Raum unter "OnPlayerDialogResponse" eintragen
  528.  
  529. Eine Schablone dafür sind in den Zeilen 356 bis 366
  530.  
  531. */
  532. stock strget(strx[], pos, search = ' ') {
  533. new arg, ret[128], idxx;
  534. for (new i = 0; i < strlen(strx); i++) {
  535. if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
  536. arg++;
  537. if (arg == pos + 1){
  538. ret[i-idxx] = EOS;
  539. return ret;
  540. } else if (arg == pos)
  541. idxx= i+1;
  542. }
  543. else if (arg == pos)
  544. ret[i - idxx] = strx[i];
  545. }
  546. return ret;
  547. }
  548. stock getName(playerid)
  549. {
  550. GetPlayerName(playerid,GetNamee,sizeof(GetNamee));
  551. return GetNamee;
  552. }
Advertisement
Add Comment
Please, Sign In to add comment