Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined VIP
- xxSPEEDYxx's V.I.P System - NEW*
- 3 Levels
- v1.0
- COMMANDS:
- V.I.P Level 1 Commands: V.I.P Level 2 Commands: V.I.P Level 3 Commands:
- /mytime /vsaveskin /vkick
- /myweather /dontuseskin /vget
- /myvw /vweapons /rw
- /mycolor /vipgoto /maxammo
- /vspec /vasay + V.I.P level 1&2 CMDS
- /vspecoff + V.I.P level 1 CMDS
- /spawnme
- /vcmds
- #endif
- //============ [ Includes ] ============//
- #include < a_samp > // Main include!
- #include < zcmd > // Gasiti aici: http://forum.sa-mp.com/showthread.php?t=91354&highlight=zcmd
- #include < sscanf2 > // Gasiti aici: http://forum.sa-mp.com/showthread.php?t=120356
- //======================================//
- #pragma tabsize 0
- #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!
- //============ [ Culori ] ============//
- #define RED 0xE60000AA
- #define YELLOW 0xFFFF00AA
- #define GREEN 0x00FF00AA
- #define ABLUE 0x2641FEAA
- #define COLOR_VIP 0xFF5500AA // Orange:P
- //====================================//
- //========== [ Dialog-uri ] ==========//
- /*
- Am pus ID-urile dialog-urilor mai mari pentru ca sa va nu inucrce
- sa spuneti ca nu va apare dialogu etc...
- Dar asta nu inseamna ca nu puteti sa le schimbati...puteti sa le schimbati
- in ce numar vreti voi:P
- */
- #define MYLVL 12000
- #define VIPS 12001
- #define VIPCMDS 12002
- #define ONCONN 12003
- //====================================//
- //============= [ SPEC ] =============//
- #define ADMIN_SPEC_TYPE_NONE 0
- #define ADMIN_SPEC_TYPE_PLAYER 1
- #define ADMIN_SPEC_TYPE_VEHICLE 2
- /*
- Lasa-ti asta asa ca sa functioneze spec-ul bine
- */
- //====================================//
- //========== [ News&Enums ] ==========//
- enum pInfo
- {
- Vip,
- SpecID,
- SpecType
- };
- new P_DATA[ MAX_PLAYERS ][ pInfo ];
- new DB:Database;
- new Float:Position[ MAX_PLAYERS ][ 4 ];
- //====================================//
- //======================================================== [ CallBacks ] ========================================================//
- public OnFilterScriptInit( )
- {
- Database = db_open( "Vips.db" );
- db_free_result( db_query( Database, "CREATE TABLE IF NOT EXISTS `Vips` \
- ( `Nume` varchar(35),\
- `VipLevel` INT,\
- `VSkin` INT )" ) );
- return 1;
- }
- public OnFilterScriptExit( )
- {
- db_close( Database );
- return 1;
- }
- public OnPlayerConnect( playerid )
- {
- new Query[ 256 ], string[ 128 ], DBResult:Result;
- format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName2( playerid ) );
- Result = db_query( Database, Query );
- if ( db_num_rows( Result ) )
- {
- new Field[ 30 ];
- db_get_field_assoc( Result, "VipLevel", Field, 30 );
- P_DATA[ playerid ][ Vip ] = strval( Field );
- 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 ] );
- ShowPlayerDialog( playerid, ONCONN, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", string, "Quit", "" );
- }
- else
- {
- ShowPlayerDialog( playerid, ONCONN+1, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", "{E60000}This username have V.I.P level 0", "Quit", "" );
- }
- db_free_result( Result );
- return 1;
- }
- public OnPlayerDisconnect( playerid, reason )
- {
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
- {
- AdvanceSpectate( i );
- }
- }
- return 1;
- }
- public OnPlayerDeath( playerid, killerid, reason )
- {
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
- {
- AdvanceSpectate( i );
- }
- }
- return 1;
- }
- public OnPlayerInteriorChange( playerid, newinteriorid, oldinteriorid )
- {
- new i = 0;
- while( i != MAX_PLAYERS )
- {
- if ( IsPlayerConnected( i ) && GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid && P_DATA[ i ][ SpecType ] == ADMIN_SPEC_TYPE_PLAYER )
- {
- SetPlayerInterior( i, newinteriorid );
- }
- i++;
- }
- }
- public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
- {
- if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
- {
- if ( newkeys == KEY_JUMP ) AdvanceSpectate( playerid );
- else if ( newkeys == KEY_SPRINT ) ReverseSpectate( playerid );
- }
- return 1;
- }
- public OnPlayerEnterVehicle( playerid, vehicleid )
- {
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
- {
- TogglePlayerSpectating( i, 1 );
- PlayerSpectateVehicle( i, vehicleid );
- P_DATA[ i ][ SpecType ] = ADMIN_SPEC_TYPE_VEHICLE;
- }
- }
- return 1;
- }
- public OnPlayerStateChange( playerid, newstate, oldstate )
- {
- switch( newstate )
- {
- case PLAYER_STATE_ONFOOT:
- {
- switch( oldstate )
- {
- case PLAYER_STATE_DRIVER: OnPlayerExitVehicle( playerid, 255 );
- case PLAYER_STATE_PASSENGER: OnPlayerExitVehicle( playerid, 255 );
- }
- }
- }
- return 1;
- }
- public OnPlayerText( playerid, text[ ] )
- {
- new textstr[ 128 ];
- if ( text[ 0 ] == '!' && P_DATA[ playerid ][ Vip ] >= 1 )
- {
- GetPlayerName( playerid, textstr, sizeof( textstr ) );
- format( textstr, sizeof( textstr ),"V.I.P Chat: {00FF00}%s{FF5500}: %s", textstr, text[ 1 ] );
- SendVipMessage( COLOR_VIP, textstr );
- return 0;
- }
- return 1;
- }
- public OnPlayerExitVehicle( playerid, vehicleid )
- {
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid && P_DATA[ i ][ SpecType ] == ADMIN_SPEC_TYPE_VEHICLE)
- {
- TogglePlayerSpectating( i, 1 );
- PlayerSpectatePlayer( i, playerid );
- P_DATA[ i ][ SpecType ] = ADMIN_SPEC_TYPE_PLAYER;
- }
- }
- return 1;
- }
- //================================================================================================================================//
- //======================================================== [ Comenzi ] ===========================================================//
- CMD:setvip( playerid, params[ ] )
- {
- new giveplayerid, level;
- new string[ 128 ], Query[ 256 ], DBResult:Resultat;
- if ( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, RED, "Only RCON Administrator can use this command!" );
- if ( sscanf( params, "ud", giveplayerid, level ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/setvip [playerid] [level]" );
- if ( giveplayerid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, RED, "Player Is Not Connected!" );
- if ( level > 3 ) return SendClientMessage( playerid, RED, "Maximum V.I.P level is 3!" );
- format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName2( playerid ) );
- Resultat = db_query( Database, Query );
- if ( !db_num_rows( Resultat ) )
- {
- P_DATA[ giveplayerid ][ Vip ] = level;
- format( string, sizeof( string ), "Administrator %s has set your V.I.P level to %d!", PlayerName2( playerid ), level );
- SendClientMessage( giveplayerid, ABLUE, string );
- format( Query, sizeof( Query ), "INSERT INTO `Vips` ( `Nume`,`VipLevel`,`VSkin` ) VALUES('%s','%d','-1')", PlayerName2( playerid ), level );
- db_free_result( db_query( Database, Query ) );
- } else {
- format( Query, sizeof( Query ), "UPDATE `Vips` SET `VipLevel` = '%d' WHERE `Nume` = '%s'", level, PlayerName2( giveplayerid ) );
- db_free_result( db_query( Database, Query ) );
- format( string, sizeof( string ), "Administrator %s has update your V.I.P level to %d", PlayerName2( playerid ), level );
- SendClientMessage( giveplayerid, ABLUE, string );
- }
- return 1;
- }
- CMD:vipgoto( playerid , params[ ] )
- {
- new PID, string[ 128 ];
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid, RED, "You need to be V.I.P level 2 or bigest to use this command!" );
- if ( sscanf( params, "u", PID ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vipgoto [playerid]" );
- new Float:x, Float:y, Float:z;
- GetPlayerPos( PID , x , y , z );
- SetPlayerInterior( playerid , GetPlayerInterior( PID ) );
- SetPlayerVirtualWorld( playerid , GetPlayerVirtualWorld( PID ) );
- if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
- {
- if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
- {
- SetVehiclePos( GetPlayerVehicleID( playerid ) , x+3 , y , z );
- LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior( PID ) );
- SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ), GetPlayerVirtualWorld( PID ) );
- format( string , sizeof( string ), "You have teleported to %s's location!" , PlayerName2( PID ) );
- SendClientMessage( playerid ,COLOR_VIP ,string );
- format( string, sizeof( string ), "V.I.P {00FF00}%s(%d) {FF5500}has teleported to your location!", PlayerName2( playerid ), P_DATA[ playerid ][ Vip ] );
- SendClientMessage( PID, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vipgoto" );
- #endif
- } else {
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vipgoto" );
- #endif
- SetPlayerPos( playerid , x+2 , y , z );
- format( string, sizeof( string ), "V.I.P {00FF00}%s(%d) {FF5500}has teleported to your location!", PlayerName2( playerid ), P_DATA[ playerid ][ Vip ] );
- SendClientMessage( PID, COLOR_VIP, string );
- format( string , sizeof( string ), "You have teleported to %s's location!" , PlayerName2( PID ) );
- SendClientMessage( playerid ,COLOR_VIP ,string ); }
- } else {
- SendClientMessage( playerid, RED, "Player not connected or is yourself!" ); }
- return 1;
- }
- CMD:spawnme( playerid, params[ ] )
- {
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid, RED, "You need to be V.I.P level 1 or bigest to use this command!" );
- SpawnPlayer( playerid );
- SendClientMessage( playerid, COLOR_VIP, "You have been respawmed!" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/spawnme" );
- #endif
- return 1;
- }
- CMD:vips( playerid, params[ ] )
- {
- new count = 0;
- new vstr[ 1048 ]; // 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
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( IsPlayerConnected( i ) && P_DATA[ i ][ Vip ] >= 1 )
- {
- format( vstr, sizeof( vstr ), "{FF5500}V.I.P: {00FF00}%s {FF5500}- Level {00FF00}%d", PlayerName2( playerid ), P_DATA[ i ][ Vip ] );
- count++;
- }
- }
- if ( count == 0 )
- {
- format ( vstr, sizeof( vstr ), "\n{E60000}No V.I.Ps online at the moment!" );
- }
- return ShowPlayerDialog( playerid, VIPS, DIALOG_STYLE_MSGBOX, "{00FF00}Online V.I.Ps:", vstr, "Quit", "" );
- }
- CMD:myweather( playerid, params[ ] )
- {
- new weather, string[ 128 ];
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid, RED, "You need to be level V.I.P 1 or bigest to use this command!" );
- if ( sscanf( params, "d", weather ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/myweather [weatherid]" );
- if ( ( weather < 0 ) || ( weather > 52 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 52 weather ids!" );
- SetPlayerWeather( playerid, weather );
- format( string, sizeof( string ), "You have set your weather to {E60000}%d", weather );
- SendClientMessage( playerid, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/myweather" );
- #endif
- return 1;
- }
- CMD:mytime( playerid, params[ ] )
- {
- new time, string[ 128 ];
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid, RED, "You need to be level V.I.P 1 or bigest to use this command!" );
- if ( sscanf( params, "d", time ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/mytime [time]" );
- if ( ( time < 0 ) || ( time > 24 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 24 hours you can set your time!" );
- SetPlayerTime( playerid, time, 0 );
- format( string, sizeof( string ), "You have set your time to {E60000}%d", time );
- SendClientMessage( playerid, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/mytime" );
- #endif
- return 1;
- }
- CMD:myvw( playerid, params[ ] )
- /*
- Cu comanda asta iti setezi Virual Wolrd-ul!
- VW = Virtual Wolrd:P ATENTIE!: Comanda asta se va folosi doar de laif ( sscanf( params, "s", VipMessage ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vasay [text]" ); V.I.P level 2:P
- Eu am pus acolo ca iti poti seta Virtual World-ul pana la 100 dar voi puteti sa schimbati in cat vreti!
- */
- {
- new vw, string[ 128 ];
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid, RED, "You need to be V.I.P level 2 or bigest to use this command!" );
- if ( sscanf( params, "d", vw ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/myvw [virtualworld]" );
- if ( ( vw < 0 ) || ( vw > 100 ) ) return SendClientMessage( playerid, RED, "Only between 0 and 100 Virtual Wolrlds you can set!" );
- if ( vw == 0 ) return SendClientMessage( playerid, YELLOW, "You have returned back in normal world( 0 )!" );
- SetPlayerVirtualWorld( playerid, vw );
- format( string, sizeof( string ), "You have set your Virtual World to {E60000}%d", vw );
- SendClientMessage( playerid, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/myvw" );
- #endif
- return 1;
- }
- CMD:vasay( playerid, params[ ] )
- {
- new VipMessage[ 180 ]; // 180 de caractere poti sa scrii intr-un mesaj din asta! Puteti sa setati in cate vreti voi!
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid, RED, "You need to be V.I.P level 2 or bigest to use this command!" );
- if ( sscanf( params, "s[ 120 ]", VipMessage ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vasay [text]" );
- format( VipMessage, sizeof( VipMessage ), "V.I.P - %s {FFFF00}(lvl: %d): {00FF00}%s", PlayerName2( playerid ), P_DATA[ playerid ][ Vip ], VipMessage );
- SendClientMessageToAll( COLOR_VIP, VipMessage );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vasay" );
- #endif
- return 1;
- }
- CMD:maxammo( playerid, params[ ] )
- {
- if ( P_DATA[ playerid ][ Vip ] == 3 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P level 3 to use this command!" );
- SendPlayerMaxAmmo( playerid );
- SendClientMessage( playerid, COLOR_VIP, "You have added {00FF00}Max Ammo{FF5500} to your weapons!" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/MaxAmmo" );
- #endif
- return 1;
- }
- CMD:vweapons( playerid, params[ ] )
- {
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid, RED, "You need to be V.I.P level 2 or bigest to use this command!" );
- GivePlayerWeapon( playerid ,28, 120); //Arma: Micro SMG || Gloante: 120 - Puteti sa schimbati numaru gloantele!
- GivePlayerWeapon( playerid, 31, 75); //Arma: M4 || Gloante: 75 - Puteti sa schimbati numaru gloantele!
- GivePlayerWeapon( playerid, 34, 15); //Arma: Sniper Rifle || Gloante: 15 - Puteti sa schimbati numaru gloantele!
- GivePlayerWeapon( playerid, 24, 110); //Arma: Desert Eagle || Gloante: 110 - Puteti sa schimbati numaru gloantele!
- GivePlayerWeapon( playerid, 26, 100); //Arma: Sawn-off Shotgun || Gloante: 100 - Puteti sa schimbati numaru gloantele!
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vweapons" );
- #endif
- //De asemenea puteti sa schimbati si armlele pe care sa dea V.I.P-iilor la comanda asta!
- //Sursa: http://wiki.sa-mp.com/wiki/Weapons || Gasiti ID-urile armelor!
- return 1;
- }
- 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!
- {
- new PID, string[ 128 ];
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P level 1 or bigest to use this command!" );
- if ( sscanf( params, "u", PID ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vspec [playerid]" );
- if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
- {
- if ( GetPlayerState( PID ) == PLAYER_STATE_SPECTATING && P_DATA[ PID ][ SpecID ] != INVALID_PLAYER_ID )
- {
- if ( GetPlayerState( PID ) != 1 && GetPlayerState( PID ) != 2 && GetPlayerState( PID ) != 3)
- {
- SpectatePlayer( playerid, PID );
- GetPlayerPos( playerid, Position[ playerid ][ 0 ], Position[ playerid ][ 1 ], Position[ playerid ][ 2 ] );
- GetPlayerFacingAngle( playerid, Position[ playerid ][ 3 ] );
- format( string, sizeof( string ), "Now you spectating %s (%d)", PlayerName2( PID ), PID );
- SendClientMessage( playerid, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vspec" );
- #endif
- } else {
- SendClientMessage( playerid, RED, "ERROR: Player not spawned!" ); }
- } else {
- SendClientMessage( playerid, RED, "ERROR: Player spectating someone else!" ); }
- } else {
- SendClientMessage( playerid, RED, "ERROR: Player is not connected or is yourself!" ); }
- return 1;
- }
- CMD:vspecoff( playerid, params[ ] )
- {
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 1 or bigest to use this command!" );
- if ( P_DATA[ playerid ][ SpecType ] != ADMIN_SPEC_TYPE_NONE )
- {
- StopSpectate( playerid );
- SetTimerEx("ReturnPosition", 3000, 0, "d", playerid );
- SendClientMessage( playerid, COLOR_VIP, "You have stop spectating" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vspecoff" );
- #endif
- } else {
- SendClientMessage( playerid, RED, "ERROR: You are not spectating" ); }
- return 1;
- }
- CMD:vsaveskin( playerid, params[ ] ) //De asemenea am pus si aici un V inainte! (V de la V.I.P :P)
- {
- new SkinID, string[ 128 ], Query[ 256 ];
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 2 or bigest to use this command!" );
- SkinID = GetPlayerSkin( playerid );
- format( Query, sizeof( Query ), "UPDATE `Vips` SET `VSkin` = '%d' WHERE `Nume` = '%s' ", SkinID, PlayerName2( playerid ) );
- db_free_result( db_query( Database, Query ) );
- format( string, sizeof( string ), "You have successfully saved this skin (ID: %d)", SkinID );
- SendClientMessage( playerid, COLOR_VIP, string );
- SendClientMessage( playerid, COLOR_VIP, "Type /dontuseskin for don't save again this skin!" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vsaveskin" );
- #endif
- return 1;
- }
- CMD:dontuseskin( playerid, params[ ] )
- {
- new Query[ 256 ];
- if ( P_DATA[ playerid ][ Vip ] <= 2 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 2 or bigest to use this command!" );
- format( Query, sizeof( Query ), "UPDATE `Vips` SET `VSkin` = '-1' WHERE `Nume` = '%s' ", PlayerName2( playerid ) );
- db_free_result( db_query( Database, Query ) );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/dontuseskin" );
- #endif
- SendClientMessage( playerid, COLOR_VIP, "Your saved skin is never been used!" );
- return 1;
- }
- CMD:mycolor( playerid, params[ ] )
- {
- new Colour, colour[ 24 ];
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 2 or bigest to use this command!" );
- 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" );
- 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" );
- switch ( Colour ) {
- case 0: { SetPlayerColor( playerid, 0x000000AA ); colour = "Black"; }
- case 1: { SetPlayerColor( playerid, 0xFFFFFFAA ); colour = "White"; }
- case 2: { SetPlayerColor( playerid, 0xE60000AA ); colour = "Red"; }
- case 3: { SetPlayerColor( playerid, 0xFF5500AA ); colour = "Orange"; }
- case 4: { SetPlayerColor( playerid, 0xFFFF00AA ); colour = "Yellow"; }
- case 5: { SetPlayerColor( playerid, 0x00FF00AA ); colour = "Green"; }
- case 6: { SetPlayerColor( playerid, 0x0000BBAA ); colour = "Blue"; }
- case 7: { SetPlayerColor( playerid, 0x800080AA ); colour = "Purple"; }
- case 8: { SetPlayerColor( playerid, 0xA52A2AAA ); colour = "Brown"; } }
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/mycolor" );
- #endif
- return 1;
- }
- CMD:vcmds( playerid, params[ ] )
- {
- new string[ 1024 ];
- if ( P_DATA[ playerid ][ Vip ] <= 1 ) return ShowPlayerDialog( playerid, VIPCMDS+1, DIALOG_STYLE_MSGBOX, "{E60000}Not Allowed", "{E60000}You need to bee V.I.P level 1 or biggest to use this command!", "Quit", "" );
- 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" );
- strcat( string, "{FFFF00}/mytime\t\t\t/vsaveskin\t\t\t/vkick\n" );
- strcat( string, "/myweather\t\t\t/dontuseskin\t\t\t/vget\n" );
- strcat( string, "/myvw\t\t\t\t/vweapons\t\t\t/vannounce\n" );
- strcat( string, "/mycolor\t\t\t/vipgoto\t\t\t/rw\n" );
- strcat( string, "/vspec\t\t\t\t/vasay\t\t\t\t/maxammo\n" );
- strcat( string, "/vspecoff\t\t\t+V.I.P level 1 CMDS\t\t+ V.I.P level 1&2 CMDS\n" );
- strcat( string, "/spawnme\n/vcmds\n\n" );
- strcat( string, "{FF5500}Use simbol {00FF00}! {FF5500}in front of your text to speak in V.I.P Chat\n" );
- ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P Commands:", string, "Quit", "" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vcmds" );
- #endif
- return 1;
- }
- CMD:vget( playerid, params[ ] )
- {
- new PID, string[ 256 ];
- new Float:x, Float:y, Float:z;
- if ( P_DATA[ playerid ][ Vip ] == 3 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 3 to use this command!" );
- if ( sscanf( params, "u", PID ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vget [playerid]" );
- if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
- {
- GetPlayerPos( playerid, x, y, z );
- SetPlayerInterior( PID, GetPlayerInterior( playerid ) );
- SetPlayerVirtualWorld( PID, GetPlayerVirtualWorld( playerid ) );
- if ( GetPlayerState( PID ) == 2 )
- {
- new VehicleID = GetPlayerVehicleID( PID );
- SetVehiclePos( VehicleID, x+3, y, z);
- LinkVehicleToInterior( VehicleID, GetPlayerInterior( PID ) );
- SetVehicleVirtualWorld( GetPlayerVehicleID( PID ), GetPlayerVirtualWorld( PID ) );
- format( string, sizeof( string ),"You have been teleported to V.I.P {00FF00}%s's {FF5500}location", PlayerName2( playerid ) );
- SendClientMessage( PID, COLOR_VIP, string );
- format( string, sizeof( string ),"You have teleported {00FF00}%s {FF5500}to your location", PlayerName2( PID ) );
- SendClientMessage( playerid, COLOR_VIP, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vget" );
- #endif
- } else {
- SetPlayerPos( PID, x+2, y, z );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vget" );
- #endif
- format( string, sizeof( string ),"You have been teleported to V.I.P {00FF00}%s's {FF5500}location", PlayerName2( playerid ) );
- SendClientMessage( PID, COLOR_VIP, string );
- format( string, sizeof( string ),"You have teleported {00FF00}%s {FF5500}to your location", PlayerName2( PID ) );
- SendClientMessage( playerid, COLOR_VIP, string ); }
- } else {
- SendClientMessage( playerid, RED, "Player is not connected or is yourself!" ); }
- return 1;
- }
- CMD:vkick( playerid, params[ ] )
- {
- new string[ 20 ], PID, reason;
- if ( P_DATA[ playerid ][ Vip ] == 3 ) return SendClientMessage( playerid , RED, "ERROR: You need to be V.I.P level 3 to use this command!" );
- if ( sscanf( params, "us[20]", PID, reason ) ) return SendClientMessage( playerid, RED, "USAGE: {FFFF00}/vkick [playerid] [reason]" );
- if ( IsPlayerConnected( PID ) && PID != INVALID_PLAYER_ID && PID != playerid )
- {
- if ( !strlen( params[ 1 ] ) )
- {
- format( string, sizeof( string ), "%s {FF5500}has been kicked by V.I.P {00FF00}%s {FF5500}[no reason given]!",PlayerName2( PID ), PlayerName2( playerid ) );
- SendClientMessageToAll( GREEN, string );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vkick" );
- #endif
- } else {
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vkick" );
- #endif
- 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);
- SendClientMessageToAll( GREEN, string ); }
- } else {
- SendClientMessage( playerid, RED, "Player is not connected or is yourself!" ); }
- return 1;
- }
- CMD:rw( playerid, params[ ] )
- {
- if ( P_DATA[ playerid ][ Vip ] == 3 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P level 3 to use this command!" );
- GivePlayerWeapon( playerid, 4, 1); //Knife
- GivePlayerWeapon( playerid, 28, 1000); // Micro - SMG
- GivePlayerWeapon( playerid, 26, 100); // Sawn-off Shotgun
- GivePlayerWeapon( playerid, 22, 500); // 9mm Pistol
- //Source: http://wiki.sa-mp.com/wiki/Weapons !
- SendClientMessage( playerid, COLOR_VIP, "You got an Runing Weapons package!" );
- #if defined VIPS_SEND_COMMAND
- SendVipsCommand( playerid, "/vkick" );
- #endif
- return 1;
- }
- forward SendVipMessage( color, const string[ ] );
- public SendVipMessage( color, const string[ ] )
- {
- for ( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( IsPlayerConnected( i ) )
- {
- if ( P_DATA[ i ][ Vip ] >= 1 )
- {
- SendClientMessage( i, color, string );
- }
- }
- }
- return 1;
- }
- forward ReturnPosition( playerid );
- public ReturnPosition( playerid )
- {
- SetPlayerPos( playerid, Position[ playerid ][ 0 ], Position[ playerid ][ 1 ], Position[ playerid ][ 2 ] );
- SetPlayerFacingAngle( playerid, Position[ playerid ][ 3 ] );
- }
- //============================================= [ Stocks ] =======================================================//
- stock PlayerName2( i ){
- new n[ 24 ];
- GetPlayerName( i, n, 24 );
- return n;
- }
- stock SpectatePlayer( playerid, PID )
- {
- new string[ 100 ], Float:health, Float:armour;
- for(new i = 0; i < MAX_PLAYERS; i++ )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] == playerid )
- {
- AdvanceSpectate( i );
- }
- }
- SetPlayerInterior( playerid, GetPlayerInterior( PID ) );
- TogglePlayerSpectating( playerid, 1 );
- if ( IsPlayerInAnyVehicle( PID ) )
- {
- PlayerSpectateVehicle( playerid, GetPlayerVehicleID( PID ) );
- P_DATA[ playerid ][ SpecID ] = PID;
- P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_VEHICLE;
- } else {
- PlayerSpectatePlayer( playerid, PID );
- P_DATA[ playerid ][ SpecID ] = PID;
- P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_PLAYER;
- }
- GetPlayerName( PID, string, sizeof( string ) );
- GetPlayerHealth( PID, health );
- GetPlayerArmour( PID, armour );
- 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 ) );
- GameTextForPlayer( playerid, string, 25000, 3 );
- return 1;
- }
- stock StopSpectate( playerid )
- {
- TogglePlayerSpectating( playerid, 0 );
- P_DATA[ playerid ][ SpecID ] = INVALID_PLAYER_ID;
- P_DATA[ playerid ][ SpecType ] = ADMIN_SPEC_TYPE_NONE;
- GameTextForPlayer( playerid,"~n~~n~~n~~w~Spectate mode ended", 1000, 3 );
- return 1;
- }
- stock AdvanceSpectate( playerid )
- {
- if ( ConnectedPlayers( ) == 2 )
- {
- StopSpectate( playerid );
- return 1;
- }
- if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
- {
- for ( new i = P_DATA[ playerid ][ SpecID] +1; i <= MAX_PLAYERS; i++ )
- {
- if ( i == MAX_PLAYERS ) i = 0;
- if ( IsPlayerConnected( i ) && i != playerid )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] != INVALID_PLAYER_ID || ( GetPlayerState( i ) != 1 && GetPlayerState( i ) != 2 && GetPlayerState( i ) != 3 ) )
- {
- continue;
- } else {
- SpectatePlayer( playerid, i );
- break;
- }
- }
- }
- }
- return 1;
- }
- stock ConnectedPlayers( )
- {
- new Connected;
- for ( new i = 0; i < MAX_PLAYERS; i++ ) if ( IsPlayerConnected( i ) ) Connected++;
- return Connected;
- }
- stock Send2Clients( playerid, Client1[ ], Client2[ ] )
- {
- new Str[ 256 ];
- format( Str, sizeof( Str ), "Usage: {FFFF00} %s", Client1 );
- SendClientMessage( playerid, RED, Str );
- format( Str, sizeof( Str ), "Colours: {00FF00} %s", Client2 );
- SendClientMessage( playerid, RED, Str );
- return 1;
- }
- #if defined VIPS_SEND_COMMAND
- stock SendVipsCommand( playerid, cmdtext[ ] )
- {
- new string[128];
- GetPlayerName( playerid, string, sizeof( string ) );
- format( string, sizeof( string ),"[V.I.P] {00FF00}%s(%d) {FF5500}has used command {00FF00}%s", string, playerid, cmdtext );
- return SendVipMessage( COLOR_VIP, string );
- }
- #endif
- stock ReverseSpectate( playerid )
- {
- if ( ConnectedPlayers( ) == 2 )
- {
- StopSpectate( playerid );
- return 1;
- }
- if ( GetPlayerState( playerid ) == PLAYER_STATE_SPECTATING && P_DATA[ playerid ][ SpecID ] != INVALID_PLAYER_ID )
- {
- for ( new i = P_DATA[ playerid ][ SpecID ]-1; i >= 0; i-- )
- {
- if ( i == 0 ) i = MAX_PLAYERS;
- if ( IsPlayerConnected( i ) && i != playerid )
- {
- if ( GetPlayerState( i ) == PLAYER_STATE_SPECTATING && P_DATA[ i ][ SpecID ] != INVALID_PLAYER_ID || ( GetPlayerState( i ) != 1 && GetPlayerState( i ) != 2 && GetPlayerState( i ) != 3 ) )
- {
- continue;
- } else {
- SpectatePlayer( playerid, i );
- break;
- }
- }
- }
- }
- return 1;
- }
- stock SendPlayerMaxAmmo( playerid )
- {
- new slot, weap, ammo;
- for ( slot = 0; slot < 14; slot++ )
- {
- GetPlayerWeaponData( playerid, slot, weap, ammo );
- if ( IsValidWeapon( weap ) )
- {
- GivePlayerWeapon( playerid, weap, 99999 );
- }
- }
- return 1;
- }
- stock IsValidWeapon( weaponid )
- {
- if ( weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47 ) return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment