Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1. // ~~~~~~ CopyRight ~~~~~~ //
  2. /* Du darfst:
  3. - Das Script benutzen
  4. - Das Script Editieren
  5.  
  6. Du darfst nicht:
  7. - Das Script veröffentlichen
  8. - Das Script publiziern
  9. - Das Script verkaufen
  10. - Das Script als deines Ausgeben
  11. - Copy Right umgehen
  12. - Copy Right unwirksam machen
  13. - Copy Right Umschreiben(Editieren)
  14. - Copy Right entfernen
  15. */
  16. // ~~~~~~ CopyRight Ende ~~~~~~ //
  17.  
  18. #define FILTERSCRIPT
  19. #include <a_samp>
  20. #include <ocmd>
  21. #include <sscanf2>
  22.  
  23. #define BLAU 0x0087FFFF
  24. #define ROT 0xE10000FF
  25. #define GELB 0xFFE600FF
  26. #define GRUEN 0x00FF00FF
  27. #define LILA 0xFF00FFFF
  28. #define GRAU 0x0FFF00FF
  29.  
  30. enum AHandy
  31. {
  32. AnruferID
  33. }
  34. new Anrufer[MAX_PLAYERS][AHandy];
  35.  
  36. new Telefoniert[MAX_PLAYERS];
  37. new HandyKlingelt[MAX_PLAYERS];
  38.  
  39. #if defined FILTERSCRIPT
  40.  
  41. public OnFilterScriptInit()
  42. {
  43. print("\n--------------------------------------");
  44. print(" Handy System by HellYeah Loaded");
  45. print("--------------------------------------\n");
  46. return 1;
  47. }
  48.  
  49. public OnFilterScriptExit()
  50. {
  51. return 1;
  52. }
  53.  
  54. #else
  55.  
  56. main()
  57. {
  58. }
  59.  
  60. #endif
  61.  
  62. public OnPlayerText(playerid, text[])
  63. {
  64. if(Telefoniert[playerid] == 1)
  65. {
  66. for(new i=0; i<GetMaxPlayers(); i++)
  67. {
  68. if(Anrufer[i][AnruferID] == playerid)
  69. {
  70. new str[128], GetName[MAX_PLAYER_NAME];
  71. GetPlayerName(playerid,GetName,sizeof(GetName));
  72. format(str,128,"Handy %s: %s",GetName,text);
  73. SendClientMessage(playerid,GRUEN,str);
  74. SendClientMessage(i,GRUEN,str);
  75. return 0;
  76. }
  77. }
  78. }
  79.  
  80. if(strlen(text) > 128) return 0;
  81.  
  82. new Float:x, Float:y, Float:z;
  83. GetPlayerPos(playerid,x,y,z);
  84. new string[280];
  85. format(string,sizeof string,"%s sagt: %s",SpielerName(playerid),text);
  86. for(new i=0; i<MAX_PLAYERS; i++)
  87. {
  88. if(IsPlayerConnected(i))
  89. {
  90. if(IsPlayerInRangeOfPoint(i,20,x,y,z))
  91. {
  92. SendClientMessage(i,GRAU,string);
  93. }
  94. }
  95. }
  96. return 0;
  97. }
  98. ocmd:anrufen(playerid, params[])
  99. {
  100. new pID, string[128], string2[128];
  101. if(sscanf(params,"u",pID))return SendClientMessage(playerid,ROT,"/anrufen [ID]");
  102. if(IsPlayerConnected(pID))
  103. {
  104. if(Telefoniert[pID] == 1)
  105. {
  106. return SendClientMessage(playerid,GRAU,"Besetzt...");
  107. }
  108. else
  109. {
  110. format(string,sizeof(string),"Du wirst von %s angerufen. Benutze /p um abzunehmen.",SpielerName(playerid));
  111. SendClientMessage(pID,GELB,string);
  112. format(string2,sizeof(string2),"Du rufst %s an, warte einen Moment.",SpielerName(pID));
  113. SendClientMessage(playerid,GELB,string2);
  114. format(string,sizeof(string),"Das Handy von %s klingelt...",SpielerName(pID));
  115. ProxDetector(40.0, pID, string, GELB,GELB,GELB,GELB,GELB);
  116. HandyKlingelt[pID] = 1;
  117. Telefoniert[playerid] = 1;
  118. Anrufer[pID][AnruferID]= playerid;
  119. Anrufer[playerid][AnruferID]= pID;
  120. return 1;
  121. }
  122. }
  123. return 1;
  124. }
  125.  
  126. ocmd:p(playerid, params[])
  127. {
  128. if(HandyKlingelt[playerid] == 1)
  129. {
  130. for(new i=0; i<GetMaxPlayers(); i++)
  131. {
  132. if(Anrufer[i][AnruferID] == playerid)
  133. {
  134. new string[128],string2[128], xname[MAX_PLAYER_NAME], xname2[MAX_PLAYER_NAME];
  135. GetPlayerName(i,xname,sizeof(xname));
  136. GetPlayerName(playerid,xname2,sizeof(xname2));
  137. format(string,sizeof(string),"Du hast den Anruf von %s angenommen. Tippe /h um aufzulegen.",xname2);
  138. format(string2,sizeof(string2),"%s hat abgehoben. Tippe /h um aufzulegen.",xname);
  139. SendClientMessage(playerid,GRAU,string);
  140. SendClientMessage(i,GRAU,string2);
  141. SetPlayerSpecialAction(i,SPECIAL_ACTION_USECELLPHONE);
  142. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
  143. Telefoniert[i] = 1;
  144. Telefoniert[playerid] = 1;
  145. HandyKlingelt[i] = 0;
  146. return 1;
  147. }
  148. }
  149. }
  150. return 1;
  151. }
  152.  
  153. ocmd:h(playerid, params[])
  154. {
  155. if(Telefoniert[playerid] == 1)
  156. {
  157. for(new i=0; i<GetMaxPlayers(); i++)
  158. {
  159. if(Anrufer[i][AnruferID] == playerid)
  160. {
  161. new string[128],string2[128],xname[MAX_PLAYER_NAME];
  162. GetPlayerName(i,xname,sizeof(xname));
  163. format(string,sizeof(string),"Der Anruf mit %s ist beendet.",xname);
  164. format(string2,sizeof(string2),"Es wurde aufgelegt...");
  165. SendClientMessage(playerid,GRAU,string);
  166. SendClientMessage(i,GRAU,string2);
  167. SendClientMessage(playerid,ROT,"Das Gespräch hat 50$ Gekostet!");
  168. SetPlayerSpecialAction(i,SPECIAL_ACTION_STOPUSECELLPHONE);
  169. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
  170. Telefoniert[i]= 0, Telefoniert[playerid]= 0;
  171. HandyKlingelt[playerid]= 0, HandyKlingelt[i]= 0;
  172. GivePlayerMoney(playerid,-50);
  173. GivePlayerMoney(playerid,-50);
  174. return 1;
  175. }
  176. }
  177. }
  178. return 1;
  179. }
  180.  
  181. ocmd:sms(playerid,params[])
  182. {
  183. new text[128], string[128], string2[128], pID, xname[MAX_PLAYER_NAME];
  184. if(sscanf(params,"us",pID,text))
  185. {
  186. return SendClientMessage(playerid,ROT,"/sms [ID] [Text]");
  187. }
  188. if(IsPlayerConnected(playerid))
  189. {
  190. if(IsPlayerConnected(pID))
  191. {
  192. format(string,sizeof(string),"SMS von %s: %s",xname,text);
  193. SendClientMessage(pID,GELB,string);
  194. format(string2,sizeof(string2),"Deine SMS: %s: %s",xname,text);
  195. SendClientMessage(playerid,GELB,string2);
  196. GivePlayerMoney(playerid,-25);
  197. SendClientMessage(playerid,ROT,"Die SMS kostet 25$");
  198. return 1;
  199. }
  200. }
  201. return 1;
  202. }
  203.  
  204. stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  205. {
  206. if(IsPlayerConnected(playerid))
  207. {
  208. new Float:posx, Float:posy, Float:posz;
  209. new Float:oldposx, Float:oldposy, Float:oldposz;
  210. new Float:tempposx, Float:tempposy, Float:tempposz;
  211. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  212. for(new i = 0; i < MAX_PLAYERS; i++)
  213. {
  214. if(!IsPlayerConnected(i))continue;
  215. GetPlayerPos(i, posx, posy, posz);
  216. tempposx = (oldposx -posx);
  217. tempposy = (oldposy -posy);
  218. tempposz = (oldposz -posz);
  219. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))SendClientMessage(i, col1, string);
  220. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))SendClientMessage(i, col2, string);
  221. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))SendClientMessage(i, col3, string);
  222. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))SendClientMessage(i, col4, string);
  223. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))SendClientMessage(i, col5, string);
  224. }
  225. }
  226. return 1;
  227. }
  228.  
  229. stock SpielerName(playerid)
  230. {
  231. new name[MAX_PLAYER_NAME];
  232. GetPlayerName(playerid,name,sizeof(name));
  233. return name;
  234. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement