Advertisement
Guest User

Signalingv2

a guest
Sep 20th, 2011
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. /*
  2. Simple Signaling System v2
  3. Made by Edvin aka: xxSPEEDYxx. Keep the credits!
  4. You can signaling with Q( Left ) and E( Right ) Keys!
  5. */
  6. #include < a_samp >
  7.  
  8. #pragma tabsize 0
  9.  
  10. #define COLOR_PINK 0xFFC0CBAA
  11. #define COLOR_ULTRARED 0xE60000AA
  12.  
  13. #define ANTISIGSPAM_TIME 5 // Number of secounds. 5 - 5 Secounds. You can change this to your own!
  14.  
  15. forward AntiSpamTimer( id );
  16.  
  17. new string[ 128 ];
  18. new AntiSigSpam[ MAX_PLAYERS ];
  19.  
  20. public OnFilterScriptInit( )
  21. {
  22. print( "xxSPEEDYxx's Simple Signaling System v2 - LOADED!" );
  23. return 1;
  24. }
  25. public OnFilterScriptExit( )
  26. {
  27. print( "xxSPEEDYxx's Simple Signaling System v2 - UNLOADED!" );
  28. return 1;
  29. }
  30. public AntiSpamTimer( id )
  31. {
  32. AntiSigSpam[ id ] = 0;
  33. return 1;
  34. }
  35.  
  36. public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
  37. {
  38. if ( newkeys == KEY_LOOK_RIGHT )
  39. {
  40. if ( IsPlayerInAnyVehicle ( playerid ) )
  41. {
  42. if ( AntiSigSpam[ playerid ] == 0 )
  43. {
  44. format ( string, sizeof ( string ), "{E60000}* %s {FFC0CB}has signaled to right( E ).", pname( playerid ) );
  45. SendClientMessageToAll( COLOR_PINK, string );
  46. format ( string, sizeof ( string ), "* >>>>>>>>>>> {E60000}%s {FFC0CB}>>>>>>>>>>>", pname( playerid ) );
  47. SendClientMessageToAll( COLOR_PINK, string );
  48. AntiSigSpam[ playerid ] = 1;
  49. SetTimerEx( "AntiSpamTimer", ANTISIGSPAM_TIME*1000, false, "d", playerid );
  50. }
  51. else
  52. {
  53. format( string, sizeof ( string ), "Anti-Spam!!!: Please wait {FFC0CB}%d {E60000}secounds to signaling again!", ANTISIGSPAM_TIME );
  54. SendClientMessage( playerid, COLOR_ULTRARED, string );
  55. }
  56. }
  57. }
  58. if ( newkeys == KEY_LOOK_LEFT )
  59. {
  60. if ( IsPlayerInAnyVehicle ( playerid ) )
  61. {
  62. if ( AntiSigSpam[ playerid ] == 0 )
  63. {
  64. format ( string, sizeof ( string ), "{E60000}* %s {FFC0CB}has signaled to left( Q ).", pname( playerid ) );
  65. SendClientMessageToAll( COLOR_PINK, string );
  66. format ( string, sizeof ( string ), "* <<<<<<<<<<< {E60000}%s {FFC0CB}<<<<<<<<<<<", pname( playerid ) );
  67. SendClientMessageToAll( COLOR_PINK, string );
  68. AntiSigSpam[ playerid ] = 1;
  69. SetTimerEx( "AntiSpamTimer", ANTISIGSPAM_TIME*1000, false, "d", playerid );
  70. }
  71. else
  72. {
  73. format( string, sizeof ( string ), "Anti-Spam!!!: Please wait {FFC0CB}%d {E60000}secounds to signaling again!", ANTISIGSPAM_TIME );
  74. SendClientMessage( playerid, COLOR_ULTRARED, string );
  75. }
  76. }
  77. }
  78. return 1;
  79. }
  80.  
  81. stock pname( playerid )
  82. {
  83. new name[ MAX_PLAYER_NAME ];
  84. GetPlayerName( playerid, name, sizeof( name ) );
  85. return name;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement