Advertisement
Guest User

Untitled

a guest
Mar 24th, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.69 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_BLUE1 0x0077dbff
  4. #define COLOR_GREY 0xAFAFAFAA
  5.  
  6. new Tollgate1;
  7. new bool:Tollgate1Use;
  8.  
  9. forward GateClose();
  10. forward GateAuto();
  11.  
  12. public OnFilterScriptInit( )
  13. {
  14.  
  15.     Tollgate1 = CreateObject(976, 2216.3156738281, -1142.8746337891, 24.80749130249, 0.0000, 0.0000, 342.13500976563);
  16.  
  17.     print( "\n[FS] *************************" );
  18.     print( "[FS] * Tom1412 Toll system *" );
  19.     print( "[FS] * Loaded ...            *" );
  20.     print( "[FS] *************************\n" );
  21.    
  22.     SetTimer("GateAuto",2000,1);
  23.     return 1;
  24. }
  25.  
  26. public OnFilterScriptExit()
  27. {
  28.     DestroyObject(Tollgate1);
  29.     return 1;
  30. }
  31.  
  32. public GateAuto()
  33. {
  34.     if(!Tollgate1Use)
  35.     {
  36.         for(new i; i<MAX_PLAYERS; i++)
  37.         {
  38.             if(IsPlayerInRangeOfPoint(i,20.0,2216.3156738281, -1142.8746337891, 24.80749130249))
  39.             {
  40.                 Tollgate1Use = true;
  41.                
  42.                 SetTimer("GateClose", 2000, 0);
  43.                 MoveObject(Tollgate1,2225.5759277344, -1146.0582275391, 24.80749130249, 6.5);
  44.                 return 1;
  45.             }
  46.         }
  47.     }
  48.     return 1;
  49. }
  50.  
  51. public OnPlayerCommandText(playerid, cmdtext[])
  52. {
  53.     if (strcmp(cmdtext, "/openhgate", true)==0)
  54.     {
  55.         if(!Tollgate1Use)
  56.         {
  57.             Tollgate1Use = true;
  58.            
  59.             GivePlayerMoney(playerid,-5);
  60.             SetTimer("GateClose", 2000, 0);
  61.             MoveObject(Tollgate1,2225.5759277344, -1146.0582275391, 24.80749130249, 6.5);
  62.            
  63.             SendClientMessage(playerid, COLOR_BLUE1,"$5 payed \n have a nice day.");
  64.             return 1;
  65.         }
  66.         return 1;
  67.     }
  68.  
  69.     return 0;
  70. }
  71.  
  72. public GateClose()
  73. {
  74.     Tollgate1Use = false;
  75.     MoveObject (Tollgate1,2216.3156738281, -1142.8746337891, 24.80749130249, 3.5);
  76.     return 1;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement