Advertisement
Guest User

VIP v3.0

a guest
May 18th, 2013
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.04 KB | None | 0 0
  1. #if defined VIP
  2. xxSPEEDYxx's V.I.P System - NEW*
  3. 3 Levels
  4. v3.0
  5. COMMANDS - [v1.0]:
  6.  
  7. V.I.P Level 1 Commands: V.I.P Level 2 Commands: V.I.P Level 3 Commands:
  8. /mytime /vsaveskin /vkick
  9. /myweather /dontuseskin /vget
  10. /myvw /vweapons /rw
  11. /mycolor /vipgoto /maxammo
  12. /vspec /vasay + V.I.P level 1&2 CMDS
  13. /vspecoff + V.I.P level 1 CMDS
  14. /spawnme
  15. /vcmds
  16.  
  17. COMMANDS - [v2.0]:
  18.  
  19. V.I.P Level 1 Commands: V.I.P Level 2 Commands: V.I.P Level 3 Commands:
  20. /ltc[1 - 13] /vipgod /vannounce
  21. /viphouse
  22. /godcar
  23. /vcar
  24. /vspa( V.I.P Special Actions! )
  25. /stophold!
  26.  
  27. //======================== Update ============================================//
  28. * This filterscript was edited at 18.05.2013, some parts of code remade from scratch.
  29. Changes:
  30. * System switched to MySQL plugin R8 (revision 20)
  31. * Updated: foreach, sscanf and ZCMD
  32. * Fixed some major bugs reported by some sa-mp.com users. Thanks !
  33. * /vipgod command updated.
  34. //============================================================================//
  35.  
  36. #endif
  37.  
  38. //============ [ Includes ] ============//
  39. #include < a_samp > // Main include!
  40. #include < a_mysql > // BlueG's MySQL Plugin. Find it: http://forum.sa-mp.com/showthread.php?t=56564
  41. #include < sscanf2 > // Find it at: http://forum.sa-mp.com/showthread.php?t=120356
  42. #include < foreach > // Find it at: http://forum.sa-mp.com/showthread.php?t=92679&highlight=foreach
  43. #include < zcmd > // Find it at: http://forum.sa-mp.com/showthread.php?t=91354&highlight=zcmd
  44. //======================================//
  45.  
  46. /*
  47. * This option is to show messages with each VIP command what used a VIP member.
  48. If you want to disable it, just make something like this:
  49.  
  50. //#define VIPS_SEND_COMMAND
  51. */
  52. #define VIPS_SEND_COMMAND
  53.  
  54. /*
  55. * This option is to show an information dialog, with player's VIP level.
  56. If you want to dialog don't show, just make something like this:
  57.  
  58. //#define SHOW_LEVEL_DIALOG
  59. */
  60. #define SHOW_LEVEL_DIALOG
  61.  
  62. /*
  63. New Feature added in v3.0
  64. * This option is for each player's VIP security. If you level this function
  65. without comment, if the joined player don't have same IP with last player
  66. what used his VIP level, a message will show for player, with this text:
  67. "SERVER: For security reasons, your VIP level hasn't been loaded !"
  68.  
  69. If you want to disable this feature, make something like this:
  70.  
  71. //#define SECURITY
  72. */
  73. #define SECURITY
  74.  
  75. /*
  76. New feature added in v3.0
  77. * If the filterscript dialogs confuse with other filterscript's or gamemode's
  78. dialogs, just change the value from this define:
  79.  
  80. #define DIALOG_IDS
  81. */
  82. #define DIALOG_IDS 4000
  83.  
  84. #define FLOAT_INFINITY Float:0x7F800000
  85.  
  86. //=========== [ MySQL Connection ] ====//
  87. /*
  88. MySQL details. Don't forget to correct these with your own mysql details.
  89. */
  90. #define mysql_host "localhost"
  91. #define mysql_user "root"
  92. #define mysql_pass ""
  93. #define mysql_db "samp"
  94. //============ [ Colours ] ============//
  95. #define RED 0xE60000AA
  96. #define YELLOW 0xFFFF00AA
  97. #define GREEN 0x00FF00AA
  98. #define ABLUE 0x2641FEAA
  99. #define COLOR_VIP 0xFF5500AA //aka Orange:P
  100.  
  101. //====================================//
  102. //============ [ Dialogs ] ===========//
  103. #define MYLVL 4000 + DIALOG_IDS
  104. #define VIPS 4000 + DIALOG_IDS
  105. #define VIPCMDS 4000 + DIALOG_IDS
  106. #define ONCONN 4000 + DIALOG_IDS
  107. #define VSPA 4000 + DIALOG_IDS
  108. //====================================//
  109. //============= [ Level Check ] ======//
  110. stock
  111. bool:False = false
  112. ;
  113.  
  114. #define VipCheck(%0,%1)\
  115. do{\
  116. if(P_DATA[(%0)][Vip] < (%1)){\
  117. new Str[128];\
  118. format(Str, 128, "~r~~h~ERROR!~n~~w~You need to be V.I.P level ~y~~h~%d ~w~to use this command!", (%1));\
  119. return GameTextForPlayer((%0), Str, 3000, 4);\
  120. }\
  121. }\
  122. while(False)
  123. //============= [ SPEC ] =============//
  124. #define ADMIN_SPEC_TYPE_NONE (0)
  125. #define ADMIN_SPEC_TYPE_PLAYER (1)
  126. #define ADMIN_SPEC_TYPE_VEHICLE (2)
  127. //=========== [ Shortcuts ] ==========//
  128. #define Public:%0(%1) \
  129. forward%0(%1); public%0(%1)
  130. //====================================//
  131. //========== [ News&Enums ] ==========//
  132. enum pInfo
  133. {
  134. Vip,
  135. SpecID,
  136. SpecType,
  137. God,
  138. CarGod,
  139. p_FavSkin,
  140. p_IP[ 17 ]
  141. };
  142.  
  143. new P_DATA[ MAX_PLAYERS ][ pInfo ];
  144. new Float:Position[ MAX_PLAYERS ][ 4 ];
  145. new gStr[ 1024 ];
  146. //====================================//
  147.  
  148. //==================== [ CallBacks ] =========================================//
  149. public OnFilterScriptInit( )
  150. {
  151. mysql_connect( mysql_host, mysql_user, mysql_pass, mysql_db );
  152.  
  153. if ( MySQLCheckConnection( ) == 0 )
  154. {
  155. print( "Please check your mysql connection!" );
  156. return SendRconCommand( "rcon exit" );
  157. }
  158.  
  159. mysql_function_query( 1, "CREATE TABLE IF NOT EXISTS `vips` (`name` TEXT DEFAULT NULL, \
  160. `level` NUMERIC DEFAULT '0', \
  161. `ip` TEXT DEFAULT NULL, \
  162. `favskin` NUMERIC DEFAULT '-1')", false, "", "" );
  163.  
  164. return 1;
  165. }
  166.  
  167. public OnFilterScriptExit( )
  168. return mysql_close( );
  169.  
  170. public OnPlayerConnect( playerid )
  171. {
  172. P_DATA[ playerid ][ Vip ] = 0;
  173. P_DATA[ playerid ][ p_FavSkin ] = -1;
  174.  
  175. format( gStr, 128, "SELECT * FROM `vips` WHERE `name` = '%s'", PlayerName( playerid ) );
  176. return mysql_function_query( 1, gStr, true, "thread_LoadLevel", "i", playerid );
  177. }
  178. public OnPlayerDisconnect( playerid )
  179. {
  180.  
  181. format( gStr, 128, "UPDATE `vips` SET `level` = %d,`favskin` = %d WHERE `name` = '%s'",
  182. P_DATA[ playerid ][ Vip ], P_DATA[ playerid ][ p_FavSkin ], PlayerName( playerid ) );
  183.  
  184. #if defined SECURITY
  185. if ( strcmp( GetIP( playerid ), P_DATA[ playerid ][ p_IP ] ) )
  186. mysql_function_query( 1, gStr, false, "", "" );
  187.  
  188. #else
  189. mysql_function_query( 1, gStr, false, "", "" );
  190.  
  191. #endif
  192.  
  193. foreach(new i : Player)
  194. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
  195. AdvanceSpectate( i );
  196.  
  197. return 1;
  198. }
  199. public OnPlayerDeath( playerid, killerid, reason )
  200. {
  201. foreach(new i : Player)
  202. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
  203. AdvanceSpectate( i );
  204.  
  205. return 1;
  206. }
  207. public OnPlayerInteriorChange( playerid, newinteriorid, oldinteriorid )
  208. {
  209. new i = 0;
  210.  
  211. while( i != MAX_PLAYERS )
  212. {
  213. if ( IsPlayerConnected( i ) && GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid && P_DATA[ i ][ SpecType ] == ADMIN_SPEC_TYPE_PLAYER )
  214. {
  215. SetPlayerInterior( i, newinteriorid );
  216. }
  217. i++;
  218. }
  219. }
  220. public OnPlayerSpawn( playerid )
  221. {
  222. if ( P_DATA[ playerid ][ p_FavSkin ] != -1 )
  223. SetPlayerSkin( playerid, P_DATA[ playerid ][ p_FavSkin ] );
  224.  
  225. return 1;
  226. }
  227. public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
  228. {
  229. if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
  230. {
  231. if ( newkeys == KEY_JUMP )
  232. AdvanceSpectate( playerid );
  233.  
  234. else if ( newkeys == KEY_SPRINT )
  235. ReverseSpectate( playerid );
  236. }
  237. return 1;
  238. }
  239. public OnPlayerEnterVehicle( playerid, vehicleid )
  240. {
  241. foreach(new i : Player)
  242. {
  243. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
  244. {
  245. TogglePlayerSpectating( i, 1 );
  246. PlayerSpectateVehicle( i, vehicleid );
  247. P_DATA[ i ][ SpecType ] = ADMIN_SPEC_TYPE_VEHICLE;
  248. }
  249. }
  250. return 1;
  251. }
  252. public OnPlayerText( playerid, text[ ] )
  253. {
  254. if ( text[ 0 ] == '!' && P_DATA[ playerid ][ Vip ] >= 1 )
  255. {
  256. format( gStr, 144, "VIP Chat: {00FF00}%s{FF5500}: %s", PlayerName( playerid ), text[ 1 ] );
  257. SendVipMessage( COLOR_VIP, gStr );
  258. return 0;
  259. }
  260. return 1;
  261. }
  262. public OnPlayerExitVehicle( playerid, vehicleid )
  263. {
  264. foreach(new i : Player)
  265. {
  266. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid && P_DATA[ i ][ SpecType ] == ADMIN_SPEC_TYPE_VEHICLE)
  267. {
  268. TogglePlayerSpectating( i, 1 );
  269. PlayerSpectatePlayer( i, playerid );
  270. P_DATA[ i ][ SpecType ] = ADMIN_SPEC_TYPE_PLAYER;
  271. }
  272. }
  273. return 1;
  274. }
  275.  
  276. public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
  277. {
  278. switch( dialogid )
  279. {
  280. case VSPA:
  281. {
  282. if ( !response )
  283. return 1;
  284.  
  285. switch( listitem )
  286. {
  287. case 0:
  288. {
  289. for ( new i = 0; i < 5; i++ )
  290. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  291. RemovePlayerAttachedObject( playerid, i );
  292.  
  293. SetPlayerAttachedObject( playerid, 1, 19086, 8, -0.049768, -0.014062, -0.108385, 87.458297, 263.478149, 184.123764, 0.622413, 1.041609, 1.012785 );
  294. SendClientMessage( playerid, COLOR_VIP, "You have holded a {00FF00}dick!" );
  295. SendClientMessage( playerid, COLOR_VIP, "To stop holding please type {00FF00}/stophold!" );
  296. }
  297. case 1:
  298. {
  299. for ( new i = 0; i < 5; i++ )
  300. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  301. RemovePlayerAttachedObject( playerid, i );
  302.  
  303. SetPlayerAttachedObject( playerid, 0, 1114, 1, 0.138007, 0.002714, -0.157366, 350.942352, 16.794704, 32.683506, 0.791829, 0.471535, 1.032759 );
  304. SetPlayerAttachedObject( playerid, 1, 1114, 1, 0.138007, 0.002714, 0.064523, 342.729064, 354.099456, 32.369094, 0.791829, 0.471535, 1.032759 );
  305. SendClientMessage( playerid, COLOR_VIP, "You have holded a {00FF00}iron!" );
  306. SendClientMessage( playerid, COLOR_VIP, "To stop holding please type {00FF00}/stophold!" );
  307. }
  308. case 2:
  309. {
  310. for ( new i = 0; i < 5; i++ )
  311. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  312. RemovePlayerAttachedObject( playerid, i );
  313.  
  314. SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
  315. SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
  316. SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
  317. SendClientMessage( playerid, COLOR_VIP, "You have holded as {00FF00}Alien!" );
  318. SendClientMessage( playerid, COLOR_VIP, "To stop holding please type {00FF00}/stophold!" );
  319. }
  320. case 3:
  321. {
  322. for ( new i = 0; i < 5; i++ )
  323. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  324. RemovePlayerAttachedObject( playerid, i );
  325.  
  326. SetPlayerAttachedObject( playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  327. SetPlayerAttachedObject( playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  328. SetPlayerAttachedObject( playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  329. SetPlayerAttachedObject( playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  330. SetPlayerAttachedObject( playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
  331. SendClientMessage( playerid, COLOR_VIP, "You have holded as {00FF00}Icread!" );
  332. SendClientMessage( playerid, COLOR_VIP, "To stop holding please type {00FF00}/stophold!" );
  333. }
  334. case 4:
  335. {
  336. SetPlayerSpecialAction( playerid, 2 ); //Jetpack!
  337. SendClientMessage( playerid, COLOR_VIP, "Jetpack Spawmed!" );
  338. }
  339. }
  340. }
  341. }
  342. return 1;
  343. }
  344. //============================================================================//
  345. //================ [ Commands v1.0 ] =========================================//
  346. CMD:setvip( playerid, params[ ] )
  347. {
  348. if ( !IsPlayerAdmin( playerid ) )
  349. return SendClientMessage( playerid, RED, "Only RCON Administrator can use this command!" );
  350.  
  351. new
  352. string[ 128 ],
  353. giveplayerid,
  354. level
  355. ;
  356. if ( sscanf( params, "ud", giveplayerid, level ) )
  357. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/setvip [playerid] [level]" );
  358.  
  359. if ( giveplayerid == INVALID_PLAYER_ID )
  360. return SendClientMessage( playerid, RED, "Player Is Not Connected!" );
  361.  
  362. if ( level > 3 || level < 0 )
  363. return SendClientMessage( playerid, RED, "ERROR: Invalid level!" );
  364.  
  365. P_DATA[ giveplayerid ][ Vip ] = level;
  366. format( string, sizeof( string ), "Administrator %s has set your V.I.P level to %d!", PlayerName( playerid ), level );
  367. SendClientMessage( giveplayerid, ABLUE, string );
  368. return 1;
  369. }
  370. CMD:vipgoto( playerid , params[ ] )
  371. {
  372. new PID, string[ 128 ];
  373. new Float:x, Float:y, Float:z;
  374.  
  375. VipCheck( playerid, 2 );
  376.  
  377. if ( sscanf( params, "u", PID ) )
  378. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vipgoto [playerid]" );
  379.  
  380. if ( IsPlayerConnected( PID ) )
  381. return SendClientMessage( playerid, RED, "Player not connected or is yourself!" );
  382.  
  383. GetPlayerPos( PID , x , y , z );
  384. SetPlayerInterior( playerid , GetPlayerInterior( PID ) );
  385. SetPlayerVirtualWorld( playerid , GetPlayerVirtualWorld( PID ) );
  386.  
  387. if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  388. {
  389. SetVehiclePos( GetPlayerVehicleID( playerid ) , x+3 , y , z );
  390. LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior( PID ) );
  391. SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ), GetPlayerVirtualWorld( PID ) );
  392. format( string , sizeof( string ), "You have teleported to %s's location!" , PlayerName( PID ) );
  393. SendClientMessage( playerid ,COLOR_VIP ,string );
  394. format( string, sizeof( string ), "V.I.P {00FF00}%s(%d) {FF5500}has teleported to your location!", PlayerName( playerid ), P_DATA[ playerid ][ Vip ] );
  395. SendClientMessage( PID, COLOR_VIP, string );
  396. } else {
  397.  
  398. SetPlayerPos( playerid , x+2 , y , z );
  399. format( string, sizeof( string ), "V.I.P {00FF00}%s(%d) {FF5500}has teleported to your location!", PlayerName( playerid ), P_DATA[ playerid ][ Vip ] );
  400. SendClientMessage( PID, COLOR_VIP, string );
  401. format( string , sizeof( string ), "You have teleported to %s's location!" , PlayerName( PID ) );
  402. SendClientMessage( playerid ,COLOR_VIP ,string );
  403. }
  404. #if defined VIPS_SEND_COMMAND
  405. SendVipsCommand( playerid, "/vipgoto" );
  406. #endif
  407. return 1;
  408. }
  409. CMD:spawnme( playerid, params[ ] )
  410. {
  411. VipCheck( playerid, 1 );
  412.  
  413. SpawnPlayer( playerid );
  414. SendClientMessage( playerid, COLOR_VIP, "You have been respawmed!" );
  415. #if defined VIPS_SEND_COMMAND
  416. SendVipsCommand( playerid, "/spawnme" );
  417. #endif
  418. return 1;
  419. }
  420. CMD:vips( playerid, params[ ] )
  421. {
  422. new
  423. V,
  424. lsString[ 1024 ]
  425. ;
  426.  
  427. foreach(new i : Player) if ( P_DATA[ i ][ Vip ] > 0 )
  428. {
  429. format( lsString, sizeof lsString, "{FF5500}%s\n{FF5500}V.I.P {00FF00}%s {FF5500}- Level {00FF00}%d", lsString, PlayerName( i ), P_DATA[ i ][ Vip ] );
  430. V++;
  431. }
  432. if ( V == 0 )
  433. format( lsString, sizeof lsString, "\n{E60000}No V.I.Ps online at the moment!" );
  434.  
  435. return ShowPlayerDialog( playerid, VIPS, DIALOG_STYLE_MSGBOX, "{00FF00}Online V.I.Ps:", lsString, "Quit", "" );
  436. }
  437. CMD:myweather( playerid, params[ ] )
  438. {
  439. new weather, string[ 128 ];
  440.  
  441. VipCheck( playerid, 1 );
  442.  
  443. if ( sscanf( params, "d", weather ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/myweather [weatherid]" );
  444. if ( ( weather < 0 ) || ( weather > 52 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 52 weather ids!" );
  445.  
  446. SetPlayerWeather( playerid, weather );
  447. format( string, sizeof( string ), "You have set your weather to {E60000}%d", weather );
  448. SendClientMessage( playerid, COLOR_VIP, string );
  449. #if defined VIPS_SEND_COMMAND
  450. SendVipsCommand( playerid, "/myweather" );
  451. #endif
  452. return 1;
  453. }
  454. CMD:mytime( playerid, params[ ] )
  455. {
  456. new time, string[ 128 ];
  457.  
  458. VipCheck( playerid, 1 );
  459.  
  460. if ( sscanf( params, "d", time ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/mytime [time]" );
  461. if ( ( time < 0 ) || ( time > 24 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 24 hours you can set your time!" );
  462.  
  463. SetPlayerTime( playerid, time, 0 );
  464. format( string, sizeof( string ), "You have set your time to {E60000}%d", time );
  465. SendClientMessage( playerid, COLOR_VIP, string );
  466. #if defined VIPS_SEND_COMMAND
  467. SendVipsCommand( playerid, "/mytime" );
  468. #endif
  469. return 1;
  470. }
  471. CMD:myvw( playerid, params[ ] )
  472. /*
  473. With this function you will be ablle to change your virtual world!
  474. Disponible Virtual Worlds are between 0 and 100 you can change to bigest or lowest on this line:
  475. if ( ( vw < 0 ) || ( vw > 100 ) )
  476. */
  477. {
  478. new vw, string[ 128 ];
  479.  
  480. VipCheck( playerid, 1 );
  481.  
  482. if ( sscanf( params, "d", vw ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/myvw [virtualworld]" );
  483. if ( ( vw < 0 ) || ( vw > 100 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 100 Virtual Worlds ar disponible!" );
  484.  
  485. if ( vw == 0 )
  486. {
  487. SetPlayerVirtualWorld( playerid, 0 );
  488. return SendClientMessage( playerid, YELLOW, "You have returned back in normal world( 0 )!" );
  489. }
  490. SetPlayerVirtualWorld( playerid, vw );
  491. format( string, sizeof( string ), "You have set your Virtual World to {E60000}%d", vw );
  492. SendClientMessage( playerid, COLOR_VIP, string );
  493. #if defined VIPS_SEND_COMMAND
  494. SendVipsCommand( playerid, "/myvw" );
  495. #endif
  496. return 1;
  497. }
  498. CMD:vasay( playerid, params[ ] )
  499. {
  500. new VipMessage[ 180 ];
  501.  
  502. VipCheck( playerid, 2 );
  503.  
  504. if ( sscanf( params, "s[ 120 ]", VipMessage ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vasay [text]" );
  505.  
  506. format( VipMessage, sizeof( VipMessage ), "V.I.P - %s {FFFF00}(lvl: %d): {00FF00}%s", PlayerName( playerid ), P_DATA[ playerid ][ Vip ], VipMessage );
  507. SendClientMessageToAll( COLOR_VIP, VipMessage );
  508. #if defined VIPS_SEND_COMMAND
  509. SendVipsCommand( playerid, "/vasay" );
  510. #endif
  511. return 1;
  512. }
  513. CMD:maxammo( playerid, params[ ] )
  514. {
  515. VipCheck( playerid, 3 );
  516.  
  517. SendPlayerMaxAmmo( playerid );
  518. SendClientMessage( playerid, COLOR_VIP, "You have added {00FF00}Max Ammo{FF5500} to your weapons!" );
  519. #if defined VIPS_SEND_COMMAND
  520. SendVipsCommand( playerid, "/MaxAmmo" );
  521. #endif
  522. return 1;
  523. }
  524. CMD:vweapons( playerid, params[ ] )
  525. {
  526. VipCheck( playerid, 2 );
  527.  
  528. GivePlayerWeapon( playerid ,28, 120) ; // Weapons: Micro SMG || Ammo: 120
  529. GivePlayerWeapon( playerid, 31, 75 ); // Weapons: M4 || Gloante: 75
  530. GivePlayerWeapon( playerid, 34, 15 ); // Weapons: Sniper Rifle || Ammo: 15
  531. GivePlayerWeapon( playerid, 26, 100 ); // Weapons: Sawn-off Shotgun || Ammo: 100
  532. #if defined VIPS_SEND_COMMAND
  533. SendVipsCommand( playerid, "/vweapons" );
  534. #endif
  535. return 1;
  536. }
  537. CMD:vspec( playerid, params[ ] )
  538. {
  539. new
  540. PID,
  541. string[ 128 ]
  542. ;
  543.  
  544. VipCheck( playerid, 1 );
  545.  
  546. if ( sscanf( params, "u", PID ) )
  547. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vspec [playerid]" );
  548.  
  549. if ( !IsPlayerConnected( PID ) )
  550. return SendClientMessage( playerid, RED, "ERROR: Player is not connected!" );
  551.  
  552. if ( GetPlayerState( PID ) == PLAYER_STATE_SPECTATING && P_DATA[ PID ][ SpecID ] != INVALID_PLAYER_ID )
  553. return SendClientMessage( playerid, RED, "ERROR: Player spectating someone else!" );
  554.  
  555. if ( GetPlayerState( PID ) == 1 && GetPlayerState( PID ) == 2 && GetPlayerState( PID ) == 3 )
  556. return SendClientMessage( playerid, RED, "ERROR: Player not spawned!" );
  557.  
  558. SpectatePlayer( playerid, PID );
  559. GetPlayerPos( playerid, Position[ playerid ][ 0 ], Position[ playerid ][ 1 ], Position[ playerid ][ 2 ] );
  560. GetPlayerFacingAngle( playerid, Position[ playerid ][ 3 ] );
  561. format( string, sizeof( string ), "Now you spectating %s (%d)", PlayerName( PID ), PID );
  562. SendClientMessage( playerid, COLOR_VIP, string );
  563. #if defined VIPS_SEND_COMMAND
  564. SendVipsCommand( playerid, "/vspec" );
  565. #endif
  566. return 1;
  567. }
  568. CMD:vspecoff( playerid, params[ ] )
  569. {
  570. VipCheck( playerid, 1 );
  571.  
  572. if ( P_DATA[ playerid ][ SpecType ] == ADMIN_SPEC_TYPE_NONE )
  573. return SendClientMessage( playerid, RED, "ERROR: You are not spectating" );
  574.  
  575. StopSpectate( playerid );
  576. SetTimerEx("ReturnPosition", 3000, 0, "d", playerid );
  577. SendClientMessage( playerid, COLOR_VIP, "You have stop spectating" );
  578. #if defined VIPS_SEND_COMMAND
  579. SendVipsCommand( playerid, "/vspecoff" );
  580. #endif
  581. return 1;
  582. }
  583. CMD:vsaveskin( playerid, params[ ] )
  584. {
  585. VipCheck( playerid, 2 );
  586.  
  587. new
  588. SkinID,
  589. string[ 128 ]
  590. ;
  591. if ( sscanf( params, "i", SkinID ) )
  592. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vsaveskin [Current SkinID]" );
  593.  
  594. if ( SkinID != GetPlayerSkin( playerid ) )
  595. return SendClientMessage( playerid, RED, "ERROR: Skin enterd don't match with your current skin!" );
  596.  
  597. if ( SkinID < 0 || SkinID > 300 )
  598. return SendClientMessage( playerid, RED, "ERROR: Invalid skin! Only between 0 and 300 !" );
  599.  
  600. format( string, sizeof( string ), "You have successfully saved this skin (ID: %d)", SkinID );
  601. SendClientMessage( playerid, COLOR_VIP, string );
  602. SendClientMessage( playerid, COLOR_VIP, "Type /dontuseskin for don't save again this skin!" );
  603.  
  604. #if defined VIPS_SEND_COMMAND
  605. SendVipsCommand( playerid, "/vsaveskin" );
  606. #endif
  607. return 1;
  608. }
  609. CMD:dontuseskin( playerid, params[ ] )
  610. {
  611. VipCheck( playerid, 2 );
  612.  
  613. P_DATA[ playerid ][ p_FavSkin ] = -1;
  614. SetPlayerSkin( playerid, random( 300 ) );
  615.  
  616. #if defined VIPS_SEND_COMMAND
  617. SendVipsCommand( playerid, "/dontuseskin" );
  618. #endif
  619. SendClientMessage( playerid, COLOR_VIP, "Your saved skin is never been used!" );
  620. return 1;
  621. }
  622. CMD:mycolor( playerid, params[ ] )
  623. {
  624. VipCheck( playerid, 1 );
  625.  
  626. new Colour, colour[ 7 ];
  627. if ( sscanf( params, "d", Colour ) )
  628. return SendClientMessage( playerid, RED, "ERROR: {FFFF00}/mycolor [color]" ), SendClientMessage( playerid, RED, "0 = Black | 1 = White | 2 = Red | 3 = Orange | 4 = Yellow | 5 = Green | 6 = Blue | 7 = Purple | 8 = Brown" );
  629.  
  630. if ( Colour > 8 )
  631. return SendClientMessage( playerid, RED, "Colours: 0 = Black | 1 = White | 2 = Red | 3 = Orange | 4 = Yellow | 5 = Green | 6 = Blue | 7 = Purple | 8 = Brown" );
  632.  
  633. switch ( Colour )
  634. {
  635. case 0: SetPlayerColor( playerid, 0x000000AA ), colour = "Black";
  636. case 1: SetPlayerColor( playerid, 0xFFFFFFAA ), colour = "White";
  637. case 2: SetPlayerColor( playerid, 0xE60000AA ), colour = "Red";
  638. case 3: SetPlayerColor( playerid, 0xFF5500AA ), colour = "Orange";
  639. case 4: SetPlayerColor( playerid, 0xFFFF00AA ), colour = "Yellow";
  640. case 5: SetPlayerColor( playerid, 0x00FF00AA ), colour = "Green";
  641. case 6: SetPlayerColor( playerid, 0x0000BBAA ), colour = "Blue";
  642. case 7: SetPlayerColor( playerid, 0x800080AA ), colour = "Purple";
  643. case 8: SetPlayerColor( playerid, 0xA52A2AAA ), colour = "Brown";
  644. }
  645.  
  646. #if defined VIPS_SEND_COMMAND
  647. SendVipsCommand( playerid, "/mycolor" );
  648. #endif
  649. return 1;
  650. }
  651. CMD:vcmds( playerid, params[ ] )
  652. {
  653. VipCheck( playerid, 1 );
  654.  
  655. strcat( gStr, "{FF5500}V.I.P Level {00FF00}1 {FF5500}Commands:\t{FF5500}V.I.P Level {00FF00}2 {FF5500}Commands:\t{FF5500}V.I.P Level {00FF00}3 {FF5500}Commands:\n\n" );
  656. strcat( gStr, "{FFFF00}/mytime\t\t\t/vsaveskin\t\t\t/vkick\n" );
  657. strcat( gStr, "/myweather\t\t\t/dontuseskin\t\t\t/vget\n" );
  658. strcat( gStr, "/myvw\t\t\t\t/vweapons\t\t\t/rw\n" );
  659. strcat( gStr, "/mycolor\t\t\t/vipgoto\t\t\t/maxammo\n" );
  660. strcat( gStr, "/vspec\t\t\t\t/vasay\t\t\t\t\n" );
  661. strcat( gStr, "/vspecoff\n/spawnme\n/vcmds\n" );
  662. strcat( gStr, "{E60000}/ltc[1-13]\t\t\t/vipgod\t\t\t/vannounce\n" );
  663. strcat( gStr, "{E60000}/godcar\n/vcar\n/vspa\n/stophold\n/viphouse\n" );
  664. strcat( gStr, "\t\t\t\t{FFFF00}+V.I.P level 1 CMDS\t\t+ V.I.P level 1&2 CMDS\n\n\n" );
  665. strcat( gStr, "{FF5500}Use simbol {00FF00}! {FF5500}in front of your text to speak in V.I.P Chat\n" );
  666. ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P Commands:", gStr, "Quit", "" );
  667. return 1;
  668. }
  669. CMD:vget( playerid, params[ ] )
  670. {
  671. new PID, string[ 256 ];
  672. new Float:x, Float:y, Float:z;
  673.  
  674. VipCheck( playerid, 3 );
  675.  
  676. if ( sscanf( params, "u", PID ) )
  677. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vget [playerid]" );
  678.  
  679. if ( !IsPlayerConnected( PID ) )
  680. return SendClientMessage( playerid, RED, "Player is not connected or is yourself!" );
  681.  
  682. GetPlayerPos( playerid, x, y, z );
  683. SetPlayerInterior( PID, GetPlayerInterior( playerid ) );
  684. SetPlayerVirtualWorld( PID, GetPlayerVirtualWorld( playerid ) );
  685. if ( GetPlayerState( PID ) == 2 )
  686. {
  687. new VehicleID = GetPlayerVehicleID( PID );
  688. SetVehiclePos( VehicleID, x+3, y, z);
  689. LinkVehicleToInterior( VehicleID, GetPlayerInterior( PID ) );
  690. SetVehicleVirtualWorld( GetPlayerVehicleID( PID ), GetPlayerVirtualWorld( PID ) );
  691. format( string, sizeof( string ),"You have been teleported to V.I.P {00FF00}%s's {FF5500}location", PlayerName( playerid ) );
  692. SendClientMessage( PID, COLOR_VIP, string );
  693. format( string, sizeof( string ),"You have teleported {00FF00}%s {FF5500}to your location", PlayerName( PID ) );
  694. SendClientMessage( playerid, COLOR_VIP, string );
  695. #if defined VIPS_SEND_COMMAND
  696. SendVipsCommand( playerid, "/vget" );
  697. #endif
  698. } else {
  699. SetPlayerPos( PID, x+2, y, z );
  700. #if defined VIPS_SEND_COMMAND
  701. SendVipsCommand( playerid, "/vget" );
  702. #endif
  703. format( string, sizeof( string ),"You have been teleported to V.I.P {00FF00}%s's {FF5500}location", PlayerName( playerid ) );
  704. SendClientMessage( PID, COLOR_VIP, string );
  705. format( string, sizeof( string ),"You have teleported {00FF00}%s {FF5500}to your location", PlayerName( PID ) );
  706. SendClientMessage( playerid, COLOR_VIP, string );
  707. }
  708. return 1;
  709. }
  710. CMD:vkick( playerid, params[ ] )
  711. {
  712. new string[ 128 ];
  713.  
  714. VipCheck( playerid, 3 );
  715.  
  716. if ( sscanf( params, "us[ 128 ]", params[ 0 ], params[ 1 ] ) )
  717. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vkick [playerid] [reason]" );
  718.  
  719. if ( IsPlayerConnected( params[ 0 ] ) )
  720. return SendClientMessage( playerid, RED, "Player is not connected !" );
  721.  
  722. if ( !strlen( params[ 1 ] ) )
  723. {
  724. format( string, sizeof( string ), "%s {FF5500}has been kicked by V.I.P {00FF00}%s {FF5500}[no reason given]!",PlayerName( params[ 0 ] ), PlayerName( playerid ) );
  725. SendClientMessageToAll( GREEN, string );
  726. Kick( params[ 0 ] );
  727. }
  728. else
  729. {
  730. format( string, sizeof( string ), "%s {FF5500}has been kicked by V.I.P {00FF00}%s {FF5500}[reason: {00FF00%s{FF5500}] ", PlayerName( params[ 0 ] ), PlayerName( playerid ), params[ 1 ] );
  731. SendClientMessageToAll( GREEN, string );
  732. Kick( params[ 0 ] );
  733. }
  734.  
  735. #if defined VIPS_SEND_COMMAND
  736. SendVipsCommand( playerid, "/vkick" );
  737. #endif
  738. return 1;
  739. }
  740. CMD:rw( playerid, params[ ] )
  741. {
  742. VipCheck( playerid, 3 );
  743.  
  744. GivePlayerWeapon( playerid, 4, 1); //Knife
  745. GivePlayerWeapon( playerid, 28, 1000); // Micro - SMG
  746. GivePlayerWeapon( playerid, 26, 100); // Sawn-off Shotgun
  747. GivePlayerWeapon( playerid, 22, 500); // 9mm Pistol
  748. //Source: http://wiki.sa-mp.com/wiki/Weapons !
  749. SendClientMessage( playerid, COLOR_VIP, "You got an Runing Weapons package!" );
  750.  
  751. #if defined VIPS_SEND_COMMAND
  752. SendVipsCommand( playerid, "/vkick" );
  753. #endif
  754. return 1;
  755. }
  756. CMD:vipgod( playerid, params[ ] )
  757. {
  758. VipCheck( playerid, 2 );
  759.  
  760. switch( P_DATA[ playerid ][ God ] )
  761. {
  762. case 0:
  763. {
  764. P_DATA[ playerid ][ God ] = 1;
  765.  
  766. SetPlayerHealth( playerid, FLOAT_INFINITY );
  767. SendClientMessage( playerid, COLOR_VIP, "You have activated the V.I.P {00FF00}God Mode!" );
  768. }
  769. case 1:
  770. {
  771. P_DATA[ playerid ][ God ] = 0;
  772. SetPlayerHealth( playerid, 100.0 );
  773. }
  774. }
  775.  
  776. #if defined VIPS_SEND_COMMAND
  777. SendVipsCommand( playerid, "/vipgod" );
  778. #endif
  779. return 1;
  780. }
  781. CMD:godcar( playerid, params[ ] )
  782. {
  783. VipCheck( playerid, 1 );
  784.  
  785. switch( P_DATA[ playerid ][ CarGod ] )
  786. {
  787. case 0:
  788. {
  789. P_DATA[ playerid ][ CarGod ] = 1;
  790. SendClientMessage( playerid, COLOR_VIP, "You have activated the Vehicle {00FF00}God Mode!" );
  791. }
  792. case 1: P_DATA[ playerid ][ CarGod ] = 0;
  793. }
  794.  
  795. #if defined VIPS_SEND_COMMAND
  796. SendVipsCommand( playerid, "/GodCar" );
  797. #endif
  798. return 1;
  799. }
  800. CMD:ltc1( playerid, params[ ] )
  801. {
  802. new Float:x, Float:y, Float:z, Float:Angle, VehiclulRt;
  803.  
  804. VipCheck( playerid, 1 );
  805.  
  806. if ( IsPlayerInAnyVehicle( playerid ) )
  807. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  808.  
  809. #if defined VIPS_SEND_COMMAND
  810. SendVipsCommand( playerid, "/ltc1" );
  811. #endif
  812. GetPlayerPos( playerid, x, y, z);
  813. GetPlayerFacingAngle( playerid, Angle );
  814. VehiclulRt = CreateVehicle( 560, x, y, z, Angle, 1, -1, -1 );
  815. PutPlayerInVehicle( playerid, VehiclulRt, 0);
  816. AddVehicleComponent( VehiclulRt, 1028 ); AddVehicleComponent( VehiclulRt, 1030 ); AddVehicleComponent( VehiclulRt, 1031 ); AddVehicleComponent( VehiclulRt, 1138 ); AddVehicleComponent(VehiclulRt, 1140); AddVehicleComponent(VehiclulRt, 1170);
  817. AddVehicleComponent( VehiclulRt, 1028 ); AddVehicleComponent( VehiclulRt, 1030 ); AddVehicleComponent( VehiclulRt, 1031 ); AddVehicleComponent( VehiclulRt, 1138 ); AddVehicleComponent(VehiclulRt, 1140); AddVehicleComponent(VehiclulRt, 1170);
  818. AddVehicleComponent( VehiclulRt, 1080 ); AddVehicleComponent( VehiclulRt, 1086 ); AddVehicleComponent( VehiclulRt, 1087 ); AddVehicleComponent( VehiclulRt, 1010 );
  819. PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
  820. ChangeVehiclePaintjob( VehiclulRt, 0 );
  821. SetVehicleVirtualWorld( VehiclulRt, GetPlayerVirtualWorld( playerid ) );
  822. LinkVehicleToInterior( VehiclulRt, GetPlayerInterior( playerid ) );
  823. return 1;
  824. }
  825. CMD:ltc2( playerid, params[ ] )
  826. {
  827. new Float:x, Float:y, Float:z, Float:Angle, VehiclulRt;
  828.  
  829. VipCheck( playerid, 1 );
  830.  
  831. if ( IsPlayerInAnyVehicle( playerid ) )
  832. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  833.  
  834. #if defined VIPS_SEND_COMMAND
  835. SendVipsCommand( playerid, "/ltc2" );
  836. #endif
  837. GetPlayerPos( playerid, x, y, z );
  838. GetPlayerFacingAngle( playerid, Angle );
  839. VehiclulRt = CreateVehicle( 560, x, y, z, Angle, 1, -1, -1 );
  840. PutPlayerInVehicle( playerid, VehiclulRt, 0 );
  841. AddVehicleComponent( VehiclulRt, 1028 ); AddVehicleComponent( VehiclulRt, 1030 ); AddVehicleComponent( VehiclulRt, 1031 ); AddVehicleComponent( VehiclulRt, 1138 ); AddVehicleComponent( VehiclulRt, 1140 ); AddVehicleComponent( VehiclulRt, 1170 );
  842. AddVehicleComponent( VehiclulRt, 1028 ); AddVehicleComponent( VehiclulRt, 1030 ); AddVehicleComponent( VehiclulRt, 1031 ); AddVehicleComponent( VehiclulRt, 1138 ); AddVehicleComponent( VehiclulRt, 1140 ); AddVehicleComponent( VehiclulRt, 1170 );
  843. AddVehicleComponent( VehiclulRt, 1080 ); AddVehicleComponent( VehiclulRt, 1086 ); AddVehicleComponent( VehiclulRt, 1087 ); AddVehicleComponent( VehiclulRt, 1010 );
  844. PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
  845. ChangeVehiclePaintjob( VehiclulRt, 1 );
  846. SetVehicleVirtualWorld( VehiclulRt, GetPlayerVirtualWorld( playerid ) );
  847. LinkVehicleToInterior( VehiclulRt, GetPlayerInterior( playerid ) );
  848. return 1;
  849. }
  850.  
  851. CMD:ltc3( playerid, params[ ] )
  852. {
  853. new Float:x, Float:y, Float:z, Float:Angle, VehiclulRt;
  854.  
  855. VipCheck( playerid, 1 );
  856.  
  857. if ( IsPlayerInAnyVehicle( playerid ) )
  858. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  859.  
  860. #if defined VIPS_SEND_COMMAND
  861. SendVipsCommand( playerid, "/ltc3" );
  862. #endif
  863. GetPlayerPos( playerid, x, y, z );
  864. GetPlayerFacingAngle( playerid, Angle );
  865. VehiclulRt = CreateVehicle( 560, x, y, z, Angle, 1, -1, -1 );
  866. PutPlayerInVehicle( playerid, VehiclulRt, 0 );
  867. AddVehicleComponent( VehiclulRt, 1028 ); AddVehicleComponent( VehiclulRt, 1138 ); AddVehicleComponent( VehiclulRt, 1170 );
  868. AddVehicleComponent( VehiclulRt, 1030 ); AddVehicleComponent( VehiclulRt, 1031 ); AddVehicleComponent( VehiclulRt, 1140 );
  869. AddVehicleComponent( VehiclulRt, 1080 ); AddVehicleComponent( VehiclulRt, 1086 ); AddVehicleComponent( VehiclulRt, 1087 ); AddVehicleComponent( VehiclulRt, 1010 );
  870. PlayerPlaySound( playerid, 1133, 0.0, 0.0, 0.0 );
  871. ChangeVehiclePaintjob( VehiclulRt, 2 );
  872. SetVehicleVirtualWorld( VehiclulRt, GetPlayerVirtualWorld( playerid ) );
  873. LinkVehicleToInterior( VehiclulRt, GetPlayerInterior( playerid ) );
  874. return 1;
  875. }
  876.  
  877. CMD:ltc4( playerid, params[ ] )
  878. {
  879. new Float:x, Float:y, Float:z, Float:Angle, carid;
  880.  
  881. VipCheck( playerid, 1 );
  882.  
  883. if ( IsPlayerInAnyVehicle( playerid ) )
  884. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  885.  
  886. #if defined VIPS_SEND_COMMAND
  887. SendVipsCommand( playerid, "/ltc4" );
  888. #endif
  889. GetPlayerPos( playerid, x, y, z );
  890. GetPlayerFacingAngle( playerid, Angle );
  891. carid = CreateVehicle( 559, x, y, z, Angle, 1, -1, -1 );
  892. PutPlayerInVehicle( playerid, carid, 0 );
  893. AddVehicleComponent( carid, 1065 ); AddVehicleComponent( carid, 1067 ); AddVehicleComponent( carid, 1073 );
  894. AddVehicleComponent( carid, 1162 ); AddVehicleComponent( carid, 1010 ); ChangeVehiclePaintjob( carid, 1 );
  895. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  896. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  897. return 1;
  898. }
  899.  
  900. CMD:ltc5( playerid, params[ ] )
  901. {
  902. new Float:x, Float:y, Float:z, Float:Angle, carid;
  903.  
  904. VipCheck( playerid, 1 );
  905.  
  906. if ( IsPlayerInAnyVehicle( playerid ) )
  907. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  908.  
  909. #if defined VIPS_SEND_COMMAND
  910. SendVipsCommand( playerid, "/ltc5" );
  911. #endif
  912. GetPlayerPos( playerid, x, y, z );
  913. GetPlayerFacingAngle( playerid, Angle );
  914. carid = CreateVehicle( 565, x, y, z, Angle, 1, -1, -1 );
  915. PutPlayerInVehicle( playerid, carid, 0 );
  916. AddVehicleComponent( carid, 1046 ); AddVehicleComponent( carid, 1049 ); AddVehicleComponent( carid, 1073 );
  917. AddVehicleComponent( carid, 1053 ); AddVehicleComponent( carid, 1010 ); ChangeVehiclePaintjob( carid, 1 );
  918. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  919. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  920. return 1;
  921. }
  922.  
  923. CMD:ltc6( playerid, params[ ] )
  924. {
  925. new Float:x, Float:y, Float:z, Float:Angle, carid;
  926.  
  927. VipCheck( playerid, 1 );
  928.  
  929. if ( IsPlayerInAnyVehicle( playerid ) )
  930. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  931.  
  932. #if defined VIPS_SEND_COMMAND
  933. SendVipsCommand( playerid, "/ltc6" );
  934. #endif
  935. GetPlayerPos( playerid, x, y, z );
  936. GetPlayerFacingAngle( playerid, Angle );
  937. carid = CreateVehicle( 558, x, y, z, Angle, 1, -1, -1 );
  938. PutPlayerInVehicle( playerid, carid, 0 );
  939. AddVehicleComponent( carid, 1088 ); AddVehicleComponent( carid, 1092 ); AddVehicleComponent( carid, 1073 );
  940. AddVehicleComponent( carid, 1139 ); AddVehicleComponent( carid, 1010 ); ChangeVehiclePaintjob( carid, 1 );
  941. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  942. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  943. return 1;
  944. }
  945.  
  946. CMD:ltc7( playerid, params[ ] )
  947. {
  948. new Float:x, Float:y, Float:z, Float:Angle, carid;
  949.  
  950. VipCheck( playerid, 1 );
  951.  
  952. if ( IsPlayerInAnyVehicle( playerid ) )
  953. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  954.  
  955. #if defined VIPS_SEND_COMMAND
  956. SendVipsCommand( playerid, "/ltc7" );
  957. #endif
  958. GetPlayerPos( playerid, x, y, z );
  959. GetPlayerFacingAngle( playerid, Angle );
  960. carid = CreateVehicle( 561, x, y, z, Angle, 1, -1, -1 );
  961. PutPlayerInVehicle( playerid, carid, 0 );
  962. AddVehicleComponent( carid, 1055 ); AddVehicleComponent( carid, 1058 ); AddVehicleComponent( carid, 1073 );
  963. AddVehicleComponent( carid, 1064 ); AddVehicleComponent( carid, 1010 ); ChangeVehiclePaintjob( carid, 1 );
  964. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  965. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  966. return 1;
  967. }
  968.  
  969. CMD:ltc8( playerid, params[ ] )
  970. {
  971. new Float:x, Float:y, Float:z, Float:Angle, carid;
  972.  
  973. VipCheck( playerid, 1 );
  974.  
  975. if ( IsPlayerInAnyVehicle( playerid ) )
  976. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  977.  
  978. #if defined VIPS_SEND_COMMAND
  979. SendVipsCommand( playerid, "/ltc8" );
  980. #endif
  981. GetPlayerPos( playerid, x, y, z );
  982. GetPlayerFacingAngle( playerid, Angle );
  983. carid = CreateVehicle( 562, x, y, z, Angle, 1, -1, -1 );
  984. PutPlayerInVehicle( playerid, carid, 0 );
  985. AddVehicleComponent( carid, 1034 ); AddVehicleComponent( carid, 1038 ); AddVehicleComponent( carid, 1073 );
  986. AddVehicleComponent( carid, 1147 ); AddVehicleComponent( carid, 1010 ); ChangeVehiclePaintjob( carid, 1 );
  987. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  988. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  989. return 1;
  990. }
  991.  
  992. CMD:ltc9( playerid, params[ ] )
  993. {
  994. new Float:x, Float:y, Float:z, Float:Angle, carid;
  995.  
  996. VipCheck( playerid, 1 );
  997.  
  998. if ( IsPlayerInAnyVehicle( playerid ) )
  999. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1000.  
  1001. #if defined VIPS_SEND_COMMAND
  1002. SendVipsCommand( playerid, "/ltc9" );
  1003. #endif
  1004. GetPlayerPos( playerid, x, y, z );
  1005. GetPlayerFacingAngle( playerid, Angle );
  1006. carid = CreateVehicle( 567, x, y, z, Angle, 1, -1, -1 );
  1007. PutPlayerInVehicle( playerid, carid, 0 );
  1008. AddVehicleComponent( carid, 1102 ); AddVehicleComponent( carid, 1129 ); AddVehicleComponent( carid, 1188 ); AddVehicleComponent( carid, 1087 ); AddVehicleComponent( carid, 1086 );
  1009. AddVehicleComponent( carid, 1133 ); AddVehicleComponent( carid, 1186 ); AddVehicleComponent( carid, 1010 ); AddVehicleComponent( carid, 1085 ); ChangeVehiclePaintjob( carid, 1 );
  1010. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1011. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1012. return 1;
  1013. }
  1014.  
  1015. CMD:ltc10( playerid, params[ ] )
  1016. {
  1017. new Float:x, Float:y, Float:z, Float:Angle, carid;
  1018.  
  1019. VipCheck( playerid, 1 );
  1020.  
  1021. if ( IsPlayerInAnyVehicle( playerid ) )
  1022. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1023.  
  1024. #if defined VIPS_SEND_COMMAND
  1025. SendVipsCommand( playerid, "/ltc10" );
  1026. #endif
  1027. GetPlayerPos( playerid, x, y, z );
  1028. GetPlayerFacingAngle( playerid, Angle );
  1029. carid = CreateVehicle( 558, x, y, z, Angle, 1, -1, -1 );
  1030. PutPlayerInVehicle( playerid, carid, 0 );
  1031. AddVehicleComponent( carid, 1092 ); AddVehicleComponent( carid, 1166 ); AddVehicleComponent( carid, 1165 ); AddVehicleComponent( carid, 1090 );
  1032. AddVehicleComponent( carid, 1094 ); AddVehicleComponent( carid, 1010 ); AddVehicleComponent( carid, 1087 ); AddVehicleComponent( carid, 1163 );
  1033. AddVehicleComponent( carid, 1091 ); ChangeVehiclePaintjob( carid, 2 );
  1034. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1035. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1036. return 1;
  1037. }
  1038.  
  1039. CMD:ltc11( playerid, params[ ] )
  1040. {
  1041. new Float:x, Float:y, Float:z, Float:Angle, carid;
  1042.  
  1043. VipCheck( playerid, 1 );
  1044.  
  1045. if ( IsPlayerInAnyVehicle( playerid ) )
  1046. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1047.  
  1048. #if defined VIPS_SEND_COMMAND
  1049. SendVipsCommand( playerid, "/ltc11" );
  1050. #endif
  1051. GetPlayerPos( playerid, x, y, z );
  1052. GetPlayerFacingAngle( playerid, Angle );
  1053. carid = CreateVehicle( 557, x, y, z, Angle, 1, 1, -1 );
  1054. PutPlayerInVehicle( playerid, carid, 0 );
  1055. AddVehicleComponent( carid, 1010 ); AddVehicleComponent( carid, 1081 );
  1056. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1057. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1058. return 1;
  1059. }
  1060. CMD:ltc12( playerid, params[ ] )
  1061. {
  1062. new Float:x, Float:y, Float:z, Float:Angle, carid;
  1063.  
  1064. VipCheck( playerid, 1 );
  1065.  
  1066. if ( IsPlayerInAnyVehicle( playerid ) )
  1067. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1068.  
  1069. #if defined VIPS_SEND_COMMAND
  1070. SendVipsCommand( playerid, "/ltc12" );
  1071. #endif
  1072. GetPlayerPos( playerid, x, y, z );
  1073. GetPlayerFacingAngle( playerid, Angle );
  1074. carid = CreateVehicle( 535, x, y, z, Angle, 1, -1, -1 );
  1075. PutPlayerInVehicle( playerid, carid, 0 );
  1076. ChangeVehiclePaintjob( carid, 1 ); AddVehicleComponent( carid, 1109 ); AddVehicleComponent( carid, 1115 ); AddVehicleComponent( carid, 1117 ); AddVehicleComponent( carid, 1073 ); AddVehicleComponent( carid, 1010 );
  1077. AddVehicleComponent( carid, 1087 ); AddVehicleComponent( carid, 1114 ); AddVehicleComponent( carid, 1081 ); AddVehicleComponent( carid, 1119 ); AddVehicleComponent( carid, 1121 );
  1078. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1079. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1080. return 1;
  1081. }
  1082. CMD:ltc13( playerid, params[ ] )
  1083. {
  1084. new Float:x, Float:y, Float:z, Float:Angle, carid;
  1085.  
  1086. VipCheck( playerid, 1 );
  1087.  
  1088. if ( IsPlayerInAnyVehicle( playerid ) )
  1089. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1090.  
  1091. #if defined VIPS_SEND_COMMAND
  1092. SendVipsCommand( playerid, "/ltc13" );
  1093. #endif
  1094.  
  1095. GetPlayerPos( playerid, x, y, z );
  1096. GetPlayerFacingAngle( playerid, Angle );
  1097. carid = CreateVehicle( 562, x, y, z, Angle, 1, -1, -1 );
  1098. PutPlayerInVehicle( playerid, carid, 0 );
  1099. AddVehicleComponent( carid, 1034 ); AddVehicleComponent( carid, 1038 ); AddVehicleComponent( carid, 1147 );
  1100. AddVehicleComponent( carid, 1010 ); AddVehicleComponent( carid, 1073 ); ChangeVehiclePaintjob( carid, 0 );
  1101. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1102. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1103. return 1;
  1104. }
  1105. CMD:vcar( playerid, params[ ] )
  1106. {
  1107. new Float:x, Float:y, Float:z, Float:Angle, carid;
  1108. VipCheck( playerid, 1 );
  1109.  
  1110. if ( IsPlayerInAnyVehicle( playerid ) )
  1111. return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );
  1112.  
  1113. #if defined VIPS_SEND_COMMAND
  1114. SendVipsCommand( playerid, "/vcar" );
  1115. #endif
  1116.  
  1117. GetPlayerPos( playerid, x, y, z );
  1118. GetPlayerFacingAngle( playerid, Angle );
  1119. carid = CreateVehicle( 402, x, y, z, Angle, 0, 0, 0 ); // Car: Buffalo
  1120. PutPlayerInVehicle( playerid, carid, 0 );
  1121. SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  1122. LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
  1123.  
  1124. //Source: http://wiki.sa-mp.com/wiki/Vehicles:All
  1125. return 1;
  1126. }
  1127. CMD:vannounce( playerid, params[ ] )
  1128. {
  1129. VipCheck( playerid, 1 );
  1130.  
  1131. if ( sscanf( params, "s[128]", params[ 0 ] ) )
  1132. return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vannounce [playerid]" );
  1133.  
  1134. GameTextForAll( params[ 0 ], 6000, 1 );
  1135.  
  1136. #if defined VIPS_SEND_COMMAND
  1137. SendVipsCommand( playerid, "/vannounce" );
  1138. #endif
  1139. return 1;
  1140. }
  1141. CMD:vspa( playerid, params[ ] )// V.I.Ps Special Actions( Holds + Jetpack! )
  1142. {
  1143. VipCheck( playerid, 1 );
  1144.  
  1145. ShowPlayerDialog( playerid, VSPA, DIALOG_STYLE_LIST, "V.I.P Special Actions!", "Hold: Dick!\nHold: Iron!\nHold: Alien!\nHold: Incred!\nSpawn: JetPack!", "Select", "Cancel" );
  1146.  
  1147. #if defined VIPS_SEND_COMMAND
  1148. SendVipsCommand( playerid, "/vspa" );
  1149. #endif
  1150. return 1;
  1151. }
  1152.  
  1153. CMD:stophold( playerid, params[ ] )
  1154. {
  1155. VipCheck( playerid, 1 );
  1156.  
  1157. if( !IsPlayerAttachedObjectSlotUsed( playerid, 0 ) &&
  1158. !IsPlayerAttachedObjectSlotUsed( playerid, 1 ) &&
  1159. !IsPlayerAttachedObjectSlotUsed( playerid, 2 ) &&
  1160. !IsPlayerAttachedObjectSlotUsed( playerid, 3 ) &&
  1161. !IsPlayerAttachedObjectSlotUsed( playerid, 4 ) )
  1162. return SendClientMessage( playerid, RED, "You are not holding any object" );
  1163.  
  1164. #if defined VIPS_SEND_COMMAND
  1165. SendVipsCommand( playerid, "/stophold" );
  1166. #endif
  1167.  
  1168. for ( new i = 0; i < 5; i ++ )
  1169. {
  1170. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  1171. {
  1172. RemovePlayerAttachedObject( playerid, i );
  1173. SendClientMessage( i, RED, "You have stopped holding object!" );
  1174. }
  1175. }
  1176. return 1;
  1177. }
  1178.  
  1179. CMD:viphouse( playerid, params[ ] )
  1180. {
  1181. VipCheck( playerid, 1 );
  1182.  
  1183. SetPlayerPos( playerid, -2637.69,1404.24,906.46 );
  1184. SetPlayerInterior( playerid, 3 );
  1185. RemovePlayerFromVehicle( playerid );
  1186.  
  1187. #if defined VIPS_SEND_COMMAND
  1188. SendVipsCommand( playerid, "/VipHouse" );
  1189. #endif
  1190.  
  1191. SendClientMessage( playerid, COLOR_VIP, "You have teleported to V.I.P House( Club )!" );
  1192. return 1;
  1193. }
  1194. //============================================================================//
  1195. Public: thread_LoadLevel( playerid )
  1196. {
  1197. if ( !IsPlayerConnected( playerid ) )
  1198. return 0;
  1199.  
  1200. new datas[ 2 ];
  1201. cache_get_data( datas[ 0 ], datas[ 1 ] );
  1202.  
  1203. if ( !datas[ 0 ] )
  1204. {
  1205. #if defined SHOW_LEVEL_DIALOG
  1206. ShowPlayerDialog( playerid, ONCONN+1, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", "{E60000}This username have V.I.P level 0", "Quit", "" );
  1207. #endif
  1208.  
  1209. format( gStr, 128, "INSERT INTO `vips` VALUES ('%s','%s')", PlayerName( playerid ), GetIP( playerid ) );
  1210. return mysql_function_query( 1, gStr, false, "", "" );
  1211. }
  1212.  
  1213. #if defined SHOW_LEVEL_DIALOG
  1214. format( gStr, 256, "\t{FF5500}Your V.I.P Level:\n\n{FF5500}You have V.I.P level {00FF00}%d\n\n{E60000}Congratulations!", P_DATA[ playerid ][ Vip ] );
  1215. ShowPlayerDialog( playerid, ONCONN, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", gStr, "Quit", "" );
  1216. #endif
  1217.  
  1218. P_DATA[ playerid ][ Vip ] = cache_get_field_content_int( 0, "level" );
  1219. P_DATA[ playerid ][ p_FavSkin ] = cache_get_field_content_int( 0, "favskin" );
  1220.  
  1221. #if defined SECURITY
  1222. cache_get_field_content( 0, "ip", gStr );
  1223. strmid( P_DATA[ playerid ][ p_IP ], gStr, strlen( gStr ), 17 );
  1224.  
  1225. if ( !strcmp( gStr, GetIP( playerid ) ) )
  1226. return SendClientMessage( playerid, ~1, "SERVER: For security reasons, your VIP level hasn't been loaded !" );
  1227.  
  1228. #endif
  1229. return 1;
  1230. }
  1231. Public: SendVipMessage( color, const string[ ] )
  1232. {
  1233. foreach(new i : Player)
  1234. if ( P_DATA[ i ][ Vip ] >= 1 )
  1235. SendClientMessage( i, color, string );
  1236.  
  1237. return 1;
  1238. }
  1239. Public: ReturnPosition( playerid )
  1240. {
  1241. SetPlayerPos( playerid, Position[ playerid ][ 0 ], Position[ playerid ][ 1 ], Position[ playerid ][ 2 ] );
  1242. SetPlayerFacingAngle( playerid, Position[ playerid ][ 3 ] );
  1243. }
  1244. Public: GodUpdate( )
  1245. {
  1246. new Float:v_Health;
  1247. foreach(new i : Player)
  1248. {
  1249. if ( P_DATA[ i ][ CarGod ] == 1 )
  1250. {
  1251. if ( IsPlayerInAnyVehicle( i ) )
  1252. {
  1253. new vid = GetPlayerVehicleID( i );
  1254.  
  1255. GetVehicleHealth( vid, v_Health );
  1256. if ( v_Health < 900.0 )
  1257. RepairVehicle( vid );
  1258. }
  1259. }
  1260. }
  1261. return 1;
  1262. }
  1263.  
  1264. //Stocks
  1265. stock PlayerName( i )
  1266. {
  1267. new n[ 24 ];
  1268. GetPlayerName( i, n, 24 );
  1269. return n;
  1270. }
  1271. stock GetIP( i )
  1272. {
  1273. new ip[ 17 ];
  1274. GetPlayerIp( i, ip, 17 );
  1275. return ip;
  1276. }
  1277. stock SpectatePlayer( playerid, PID )
  1278. {
  1279. new Float:health, Float:armour;
  1280.  
  1281. foreach(new i : Player)
  1282. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
  1283. AdvanceSpectate( i );
  1284.  
  1285. SetPlayerInterior( playerid, GetPlayerInterior( PID ) );
  1286. TogglePlayerSpectating( playerid, 1 );
  1287.  
  1288. if ( IsPlayerInAnyVehicle( PID ) )
  1289. {
  1290. PlayerSpectateVehicle( playerid, GetPlayerVehicleID( PID ) );
  1291. P_DATA[ playerid ][ SpecID ] = PID;
  1292. P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_VEHICLE;
  1293. }
  1294. else
  1295. {
  1296. PlayerSpectatePlayer( playerid, PID );
  1297. P_DATA[ playerid ][ SpecID ] = PID;
  1298. P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_PLAYER;
  1299. }
  1300.  
  1301. GetPlayerHealth( PID, health );
  1302. GetPlayerArmour( PID, armour );
  1303.  
  1304. format( gStr, 128,"~n~~n~~n~~n~~n~~n~~n~n~~w~%s - id:%d~n~< sprint - jump >~n~~r~Health:%0.1f ~b~Armour:%0.1f~n~~g~$%d~n~~g~%d", PlayerName( PID ), PID, health, armour, GetPlayerMoney( PID ), GetPlayerScore( PID ) );
  1305. GameTextForPlayer( playerid, gStr, 25000, 3 );
  1306. return 1;
  1307. }
  1308. stock StopSpectate( playerid )
  1309. {
  1310. TogglePlayerSpectating( playerid, 0 );
  1311. P_DATA[ playerid ][ SpecID ] = INVALID_PLAYER_ID;
  1312. P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_NONE;
  1313. GameTextForPlayer( playerid,"~n~~n~~n~~w~Spectate mode ended", 1000, 3 );
  1314. return 1;
  1315. }
  1316. stock AdvanceSpectate( playerid )
  1317. {
  1318. if ( ConnectedPlayers( ) == 2 )
  1319. return StopSpectate( playerid );
  1320.  
  1321. if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
  1322. {
  1323. for ( new i = P_DATA[ playerid ][ SpecID] +1; i <= MAX_PLAYERS; i++ )
  1324. {
  1325. if ( i == MAX_PLAYERS ) i = 0;
  1326. if ( IsPlayerConnected( i ) && i != playerid )
  1327. {
  1328. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] != INVALID_PLAYER_ID || ( GetPlayerState( i ) != 1 && GetPlayerState( i ) != 2 && GetPlayerState( i ) != 3 ) )
  1329. {
  1330. continue;
  1331. } else {
  1332. SpectatePlayer( playerid, i );
  1333. break;
  1334. }
  1335. }
  1336. }
  1337. }
  1338. return 1;
  1339. }
  1340. stock ConnectedPlayers( )
  1341. {
  1342. new Connected;
  1343.  
  1344. foreach(new i : Player)
  1345. Connected++;
  1346.  
  1347. return Connected;
  1348. }
  1349.  
  1350. #if defined VIPS_SEND_COMMAND
  1351. stock SendVipsCommand( playerid, cmdtext[ ] )
  1352. {
  1353. format( gStr, 144, "[V.I.P] {00FF00}%s(%d) {FF5500}has used command {00FF00}%s", PlayerName( playerid ), playerid, cmdtext );
  1354. return SendVipMessage( COLOR_VIP, gStr );
  1355. }
  1356. #endif
  1357.  
  1358. stock ReverseSpectate( playerid )
  1359. {
  1360. if ( ConnectedPlayers( ) == 2 )
  1361. return StopSpectate( playerid );
  1362.  
  1363. if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
  1364. {
  1365. for ( new i = P_DATA[ playerid ][ SpecID ] - 1; i >= 0; i-- )
  1366. {
  1367. if ( i == 0 )
  1368. i = MAX_PLAYERS;
  1369.  
  1370. if ( IsPlayerConnected( i ) && i != playerid )
  1371. {
  1372. if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] != INVALID_PLAYER_ID ||
  1373. ( GetPlayerState( i ) != 1 && GetPlayerState( i ) != 2 && GetPlayerState( i ) != 3 ) )
  1374. continue;
  1375.  
  1376. else
  1377. SpectatePlayer( playerid, i );
  1378.  
  1379. break;
  1380. }
  1381. }
  1382. }
  1383. return 1;
  1384. }
  1385. stock SendPlayerMaxAmmo( playerid )
  1386. {
  1387. new slot, weap, ammo;
  1388.  
  1389. for ( slot = 0; slot < 14; slot++ )
  1390. {
  1391. GetPlayerWeaponData( playerid, slot, weap, ammo );
  1392. if ( IsValidWeapon( weap ) )
  1393. GivePlayerWeapon( playerid, weap, 99999 );
  1394.  
  1395. }
  1396. return 1;
  1397. }
  1398. stock IsValidWeapon( weaponid )
  1399. {
  1400. if ( weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47 )
  1401. return 1;
  1402.  
  1403. return 0;
  1404. }
  1405. stock MySQLCheckConnection( )
  1406. {
  1407. if ( mysql_ping( ) != 1 )
  1408. return 0;
  1409.  
  1410. else
  1411. return 1;
  1412. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement