Advertisement
Guest User

Ho_Handy v.1.0 ©

a guest
Aug 27th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf>
  3.  
  4.  
  5. #define FILTERSCRIPT
  6. #define COLOR_RED 0xFF0000FF
  7. #define COLOR_YELLOW 0xFFFF00FF
  8. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  9.  
  10. new Call[MAX_PLAYERS];
  11. new handystatus[MAX_PLAYERS];
  12. new IstAmAnrufen[MAX_PLAYERS];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("\n|-------------------------------------|");
  17. print(" Handysystem (c) by |GSR|Honig");
  18. print("|------------------------------------|\n");
  19. return 1;
  20. }
  21.  
  22. public OnFilterScriptExit()
  23. {
  24. return 1;
  25. }
  26.  
  27.  
  28. public OnPlayerRequestClass(playerid, classid)
  29. {
  30. return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35. SendClientMessage(playerid,COLOR_YELLOW,".:: Dieser Server benutzt das Handysystem Ho_Handy v.1.0! :.");
  36. handystatus[playerid] = 1;
  37. return 1;
  38. }
  39.  
  40. public OnPlayerDisconnect(playerid, reason)
  41. {
  42. return 1;
  43. }
  44.  
  45. public OnPlayerSpawn(playerid)
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerDeath(playerid, killerid, reason)
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnVehicleSpawn(vehicleid)
  56. {
  57. return 1;
  58. }
  59.  
  60. public OnVehicleDeath(vehicleid, killerid)
  61. {
  62. return 1;
  63. }
  64.  
  65. public OnPlayerText(playerid, text[])
  66. {
  67. if(Call[playerid] != -1)
  68. {
  69. new string[128];
  70. new pID = Call[playerid];
  71. format(string,sizeof(string),"[Handy] %s",text);
  72. SendClientMessage(playerid,COLOR_YELLOW,string);
  73. format(string,sizeof(string),"[Handy] %s",text);
  74. SendClientMessage(pID,COLOR_YELLOW,string);
  75. }
  76. return 1;
  77. }
  78.  
  79. public OnPlayerCommandText(playerid, cmdtext[])
  80. {
  81. dcmd(call,4,cmdtext);
  82. dcmd(hangup,6,cmdtext);
  83. dcmd(togphone,8,cmdtext);
  84. return 0;
  85. }
  86.  
  87. //============================================================================//
  88.  
  89. dcmd_call(playerid,params[])
  90. {
  91. new pid;
  92. if(sscanf(params,"i",pid)) return SendClientMessage(playerid,COLOR_RED,"Benutze /call [ID]");
  93. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid,COLOR_RED,"SpielerID wurde nicht gefunden!");
  94. if(IstAmAnrufen[pid] == 1) return SendClientMessage(playerid,COLOR_RED,"Der Spieler ist zurzeit nicht erreichbar!");
  95. if(handystatus[pid] == 0) return SendClientMessage(playerid,COLOR_RED,"Der Spieler hat sein Handy aus!");
  96. if(handystatus[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"Du hast dein Handy aus!");
  97.  
  98. new string[128];
  99. new pidname[MAX_PLAYER_NAME];
  100. new name[MAX_PLAYER_NAME];
  101. GetPlayerName(pid,pidname,sizeof(pidname));
  102. GetPlayerName(playerid,name,sizeof(name));
  103. format(string,sizeof(string),"Du nimmst dein Handy raus und versuchst %s anzurufen!",pidname);
  104. SendClientMessage(playerid,COLOR_YELLOW,string);
  105. format(string,sizeof(string),"** Eingehender Anruf von %s! Du nimmst ab...",name);
  106. SendClientMessage(pid,COLOR_YELLOW,string);
  107. IstAmAnrufen[playerid] = 1;
  108. IstAmAnrufen[pid] = 1;
  109. Call[pid] = playerid;
  110. Call[playerid] = pid;
  111. return 1;
  112. }
  113. dcmd_hangup(playerid,params[])
  114. {
  115. #pragma unused params
  116. if(Call[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"Du bist nicht am telefonieren!");
  117.  
  118. new pid = Call[playerid];
  119. IstAmAnrufen[playerid] = 0;
  120. IstAmAnrufen[pid] = 0;
  121. Call[pid] = -1;
  122. Call[playerid] = -1;
  123. SendClientMessage(playerid,COLOR_RED,"Du hast aufgelegt!");
  124. SendClientMessage(pid,COLOR_RED,"Der Gesprächspartner hat aufgelegt!");
  125. return 1;
  126. }
  127. dcmd_togphone(playerid,params[])
  128. {
  129. #pragma unused params
  130. if(Call[playerid] != -1) return SendClientMessage(playerid,COLOR_RED,"Während einem Gespräch kannst du dein Handy nicht ausschalten!");
  131.  
  132. if(handystatus[playerid] == 1) { handystatus[playerid] = 0; SendClientMessage(playerid,COLOR_RED,"Du schaltest dein Handy aus!"); }
  133. else if(handystatus[playerid] == 0) { handystatus[playerid] = 1; SendClientMessage(playerid,COLOR_YELLOW,"Du schaltest dein Handy aus!"); }
  134. return 1;
  135. }
  136.  
  137. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  138. {
  139. return 1;
  140. }
  141.  
  142. public OnPlayerExitVehicle(playerid, vehicleid)
  143. {
  144. return 1;
  145. }
  146.  
  147. public OnPlayerStateChange(playerid, newstate, oldstate)
  148. {
  149. return 1;
  150. }
  151.  
  152. public OnPlayerEnterCheckpoint(playerid)
  153. {
  154. return 1;
  155. }
  156.  
  157. public OnPlayerLeaveCheckpoint(playerid)
  158. {
  159. return 1;
  160. }
  161.  
  162. public OnPlayerEnterRaceCheckpoint(playerid)
  163. {
  164. return 1;
  165. }
  166.  
  167. public OnPlayerLeaveRaceCheckpoint(playerid)
  168. {
  169. return 1;
  170. }
  171.  
  172. public OnRconCommand(cmd[])
  173. {
  174. return 1;
  175. }
  176.  
  177. public OnPlayerRequestSpawn(playerid)
  178. {
  179. return 1;
  180. }
  181.  
  182. public OnObjectMoved(objectid)
  183. {
  184. return 1;
  185. }
  186.  
  187. public OnPlayerObjectMoved(playerid, objectid)
  188. {
  189. return 1;
  190. }
  191.  
  192. public OnPlayerPickUpPickup(playerid, pickupid)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnVehicleMod(playerid, vehicleid, componentid)
  198. {
  199. return 1;
  200. }
  201.  
  202. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  203. {
  204. return 1;
  205. }
  206.  
  207. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  208. {
  209. return 1;
  210. }
  211.  
  212. public OnPlayerSelectedMenuRow(playerid, row)
  213. {
  214. return 1;
  215. }
  216.  
  217. public OnPlayerExitedMenu(playerid)
  218. {
  219. return 1;
  220. }
  221.  
  222. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  223. {
  224. return 1;
  225. }
  226.  
  227. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  228. {
  229. return 1;
  230. }
  231.  
  232. public OnRconLoginAttempt(ip[], password[], success)
  233. {
  234. return 1;
  235. }
  236.  
  237. public OnPlayerUpdate(playerid)
  238. {
  239. return 1;
  240. }
  241.  
  242. public OnPlayerStreamIn(playerid, forplayerid)
  243. {
  244. return 1;
  245. }
  246.  
  247. public OnPlayerStreamOut(playerid, forplayerid)
  248. {
  249. return 1;
  250. }
  251.  
  252. public OnVehicleStreamIn(vehicleid, forplayerid)
  253. {
  254. return 1;
  255. }
  256.  
  257. public OnVehicleStreamOut(vehicleid, forplayerid)
  258. {
  259. return 1;
  260. }
  261.  
  262. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  263. {
  264. return 1;
  265. }
  266.  
  267. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  268. {
  269. return 1;
  270. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement