Advertisement
Guest User

SQLVip v2.0

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