Advertisement
Guest User

Pagalbos

a guest
Jan 2nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.69 KB | None | 0 0
  1.  
  2. #define MAX_ENTRANCES 100
  3. enum entInfo
  4. {
  5.     entName[ 128 ],
  6.     Float:entXx,
  7.     Float:entYy,
  8.     Float:entZz,
  9.     Float:iXx,
  10.     Float:iYy,
  11.     Float:iZz,
  12.     iIntt,
  13.     Text3D:entLabel,
  14.     Zte[256],
  15.     bool:enabled
  16. }
  17. new
  18.     entData[ MAX_ENTRANCES ][ entInfo ];
  19. new
  20.     totalEntrances;
  21.    
  22.  
  23. stock Entrance( name[], Float:entX, Float: entY, Float:entZ, Float:iX, Float:iY, Float:iZ, iInt )
  24. {
  25.     totalEntrances ++;
  26.    
  27.     entData[ totalEntrances ][ enabled ] = true;
  28.    
  29.     format( entData[ totalEntrances ][ entName ], 128, "%s", name );
  30.    
  31.     entData[ totalEntrances ][ entXx ] = entX;
  32.     entData[ totalEntrances ][ entYy ] = entY;
  33.     entData[ totalEntrances ][ entZz ] = entZ;
  34.    
  35.     entData[ totalEntrances ][ iXx ] = iX;
  36.     entData[ totalEntrances ][ iYy ] = iY;
  37.     entData[ totalEntrances ][ iZz ] = iZ;
  38.    
  39.     entData[ totalEntrances ][ iIntt ] = iInt;
  40.     new tmpStr[ 185 ];
  41.     format(tmpStr, 185, "{8C8C8C}%s\n{8C8C8C}Spauskite {00CC00}[ENTER]", name );
  42.     entData[ totalEntrances ][ entLabel ] = Create3DTextLabel( tmpStr, 0x008080FF, entX, entY, entZ, 10, 0, 0);
  43.     CreatePickup(19197, 23, entX, entY, entZ, 0);
  44.     return totalEntrances;
  45. }
  46. stock EntranceWithMSG(name[], Float:entX, Float: entY, Float:entZ, Float:iX, Float:iY, Float:iZ, iInt, text[])
  47. {
  48.     totalEntrances ++;
  49.  
  50.     entData[ totalEntrances ][ enabled ] = true;
  51.  
  52.     format( entData[ totalEntrances ][ entName ], 128, "%s", name );
  53.  
  54.     entData[ totalEntrances ][ entXx ] = entX;
  55.     entData[ totalEntrances ][ entYy ] = entY;
  56.     entData[ totalEntrances ][ entZz ] = entZ;
  57.  
  58.     entData[ totalEntrances ][ iXx ] = iX;
  59.     entData[ totalEntrances ][ iYy ] = iY;
  60.     entData[ totalEntrances ][ iZz ] = iZ;
  61.  
  62.     entData[ totalEntrances ][ iIntt ] = iInt;
  63.     format(entData[ totalEntrances ][ Zte ], 256, "%s", text);
  64.     new tmpStr[ 185 ];
  65.     format(tmpStr, 185, "{8C8C8C}%s\n{8C8C8C}Spauskite {00CC00}[ENTER]", name );
  66.     entData[ totalEntrances ][ entLabel ] = Create3DTextLabel( tmpStr, 0x008080FF, entX, entY, entZ, 10, 0, 0);
  67.     CreatePickup(19197, 23, entX, entY, entZ, 0);
  68.     return totalEntrances;
  69. }
  70. stock DeleteEntrance( eID )
  71. {
  72.     entData[ eID ][ enabled ] = false;
  73.     Delete3DTextLabel( entData[ eID ][ entLabel ] );
  74.     return 1;
  75. }
  76.  
  77. stock EntranceKey(playerid, newkeys)
  78. {
  79.     if (newkeys & KEY_SECONDARY_ATTACK)
  80.     {
  81.         for( new e; e < MAX_ENTRANCES; e++)
  82.         {
  83.             if( entData[ e ][ enabled ] )
  84.             {
  85.                 if( IsPlayerInRangeOfPoint( playerid, 2, entData[ e ][ entXx ], entData[ e ][ entYy ], entData[ e ][ entZz ] ))
  86.                 {
  87.                     SetPlayerPos( playerid, entData[ e ][ iXx ], entData[ e ][ iYy ], entData[ e ][ iZz ]);
  88.                     SetPlayerInterior( playerid, entData[ e ][ iIntt ] );
  89.                     SendClientMessage(playerid, -1, entData[ e ][ Zte ]);
  90.                 }
  91.             }
  92.         }
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement