Setting player at certain score certainc ommands
#1

so i want it when a player gets to say 200 score that it lets them use the commands same as vip can

and also i want it that when they reach the score it sends a message to all players saying something like "player dave reaches 200 score congratulations.

pawn Код:
#if defined VIP
                                                xxSPEEDYxx's V.I.P System - NEW*
                                                           edited



                                                         
                                                                                       
   
   




#endif
                                                //============ [ Includes ] ============//
                                                        #include <  a_samp  > // Main include!
                                                        #include <  zcmd    > // Find it on: https://sampforum.blast.hk/showthread.ph...light=zcmd
                                                        #include <  sscanf2 > // Find it on: https://sampforum.blast.hk/showthread.php?tid=120356
                                                //======================================//

#pragma tabsize 0
#define VIPS_SEND_COMMAND //Put this: // In front of this define to do not use //VIPS_SEND_COMAND

//============ [ Colours ] ============//
#define RED         0xff0000AA
#define YELLOW      0xFFFF00AA
#include <streamer>
#define GREEN       0x00FF00AA
#define ABLUE       0x2641FEAA
#define COLOR_VIP   0xFF5500AA //aka Orange:P
//====================================//
//========== [ Dialogs ] ==========//
/*
I put the dialogids bigest to not confuse with other dialogs in your FSs/GM
*/
#define MYLVL       12000
#define VIPS        12001
#define VIPCMDS     12002
#define ONCONN      12003
#define VSPA        12004
#define COLOR_RED 0xff0000FF
#define COLOR_LIGHTBLUE 0xFF0000FF
#define DialogRules

//====================================//
//============= [ SPEC ] =============//
#define ADMIN_SPEC_TYPE_NONE 0
#define ADMIN_SPEC_TYPE_PLAYER 1
#define ADMIN_SPEC_TYPE_VEHICLE 2
/*
Do not touch this!
*/
//=========== [ Shortcuts ] ==========//
#define Public:%0(%1) \
    forward%0(%1); public%0(%1)
//====================================//
//========== [ News&Enums ] ==========//
enum pInfo
{
    Vip,
    SpecID,
    SpecType,
    God,
    CarGod
};

new P_DATA[ MAX_PLAYERS ][ pInfo ];
new DB:Database;
new Float:Position[ MAX_PLAYERS ][ 4 ];
new OBJECT;
new company1;

forward close();
new pickup1;
new pickup2;
new vehicle;
new AdminDuty[MAX_PLAYERS];
new Text3D:label[MAX_PLAYERS];

//====================================//
//======================================================== [ CallBacks ] ========================================================//
public OnFilterScriptInit( )
{
    Database = db_open( "Vips.db" ); //Name of the database! You can change it!
    db_free_result( db_query( Database, "CREATE TABLE IF NOT EXISTS `Vips` \
                                        ( `Nume` TEXT,\
                                          `VipLevel` NUMERIC,\
                                          `VSkin` NUMERIC )" ) );
                                         
CreateDynamicObject(3578, 1176.8000488281, 1378.0999755859, 10.5, 0, 0, 270.5);
CreateDynamicObject(3578, 1176.9000244141, 1368.5999755859, 10.5, 0, 0, 270.49987792969);
CreateDynamicObject(18239, 1169.5, 1229.1999511719, 9.8000001907349, 0, 0, 269.99996948242);
CreateDynamic3DTextLabel("GO INTO VIP AREA ",0x00FF00FF,1168.3235, 1363.9564, 10.8203,40.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID);
CreateDynamic3DTextLabel("EXIT THE VIP AREA",0x00FF00FF,1164.62, 1343.79, 10.81,40.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID);
CreateDynamic3DTextLabel("THE VIP AREA",0xFF0000AA,1143.84, 1365.58, 10.74,45.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID);
CreateDynamicObject(8059, 1115.8000488281, 1224.1999511719, 13.199999809265, 0, 0, 90);
CreateDynamicObject(982, 1144.9000244141, 1244.1999511719, 10.5, 0, 0, 270);
CreateDynamicObject(982, 1154.5, 1244.1999511719, 10.5, 0, 0, 269.99450683594);
CreateDynamicObject(9131, 1167.6999511719, 1244.0999755859, 10.800000190735, 0, 0, 0);
CreateDynamicObject(9131, 1175.6999511719, 1244, 10.800000190735, 0, 0, 0);
CreateDynamicObject(987, 1130.6999511719, 1362.9000244141, 15.199999809265, 0, 0, 179.75006103516);
CreateDynamicObject(987, 1118.6999511719, 1362.9000244141, 15.199999809265, 0, 0, 179.74731445313);
CreateDynamicObject(987, 1109.8000488281, 1362.9000244141, 15.199999809265, 0, 0, 179.74731445313);
CreateDynamicObject(987, 1097.8000488281, 1363.0999755859, 15.199999809265, 0, 0, 270.49731445313);
CreateDynamicObject(987, 1097.9000244141, 1351.0999755859, 15.199999809265, 0, 0, 270.49438476563);
CreateDynamicObject(987, 1098, 1339.0999755859, 15.199999809265, 0, 0, 270.49438476563);
CreateDynamicObject(987, 1098.0999755859, 1327.0999755859, 15.199999809265, 0, 0, 269.24438476563);
CreateDynamicObject(987, 1097.9000244141, 1315.0999755859, 15.199999809265, 0, 0, 269.24194335938);
CreateDynamicObject(987, 1097.6999511719, 1303.0999755859, 15.199999809265, 0, 0, 269.99194335938);
CreateDynamicObject(987, 1097.6999511719, 1291.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1279.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1267.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1255.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1243.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1231.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1219.0999755859, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1215.4000244141, 15.199999809265, 0, 0, 269.98901367188);
CreateDynamicObject(987, 1097.6999511719, 1203.5, 15.199999809265, 0, 0, 0.239013671875);
CreateDynamicObject(987, 1109.6999511719, 1203.5, 15.199999809265, 0, 0, 0.2362060546875);
CreateDynamicObject(987, 1121.6999511719, 1203.5999755859, 15.199999809265, 0, 0, 0.2362060546875);
CreateDynamicObject(987, 1133.6999511719, 1203.5999755859, 15.199999809265, 0, 0, 0.2362060546875);
CreateDynamicObject(987, 1145.1999511719, 1203.6999511719, 15.199999809265, 0, 0, 0.2362060546875);
CreateDynamicObject(987, 1157.1999511719, 1203.6999511719, 15.199999809265, 0, 0, 90.236206054688);
CreateDynamicObject(987, 1157.1999511719, 1211.4000244141, 15.199999809265, 0, 0, 90.230712890625);
CreateDynamicObject(987, 1157.1999511719, 1223.4000244141, 15.199999809265, 0, 0, 359.98071289063);
CreateDynamicObject(987, 1164.4000244141, 1223.4000244141, 15.199999809265, 0, 0, 0.97802734375);
CreateDynamicObject(987, 1165, 1223.4000244141, 15.199999809265, 0, 0, 0.977783203125);
CreateDynamicObject(987, 1176.9000244141, 1223.5, 15.199999809265, 0, 0, 90.477783203125);
CreateDynamicObject(987, 1176.8000488281, 1235.5, 15.199999809265, 0, 0, 90.472412109375);
CreateDynamicObject(987, 1176.6999511719, 1247.5, 15.199999809265, 0, 0, 90.472412109375);
CreateDynamicObject(987, 1176.5999755859, 1259.5, 15.199999809265, 0, 0, 90.472412109375);
CreateDynamicObject(987, 1176.5, 1271.5, 15.199999809265, 0, 0, 90.472412109375);
CreateDynamicObject(987, 1176.4000244141, 1283.5, 15.199999809265, 0, 0, 88.722412109375);
CreateDynamicObject(987, 1176.6999511719, 1295.5, 15.199999809265, 0, 0, 88.720092773438);
CreateDynamicObject(987, 1177, 1307.5, 15.199999809265, 0, 0, 90.470092773438);
CreateDynamicObject(987, 1176.9000244141, 1319.5, 15.199999809265, 0, 0, 90.466918945313);
CreateDynamicObject(987, 1176.8000488281, 1331.5, 15.199999809265, 0, 0, 90.466918945313);
CreateDynamicObject(987, 1176.6999511719, 1343.5, 15.199999809265, 0, 0, 90.466918945313);
CreateDynamicObject(987, 1176.5999755859, 1351.1999511719, 15.199999809265, 0, 0, 90.466918945313);
CreateDynamicObject(987, 1176.5, 1362.8000488281, 13.699999809265, 0, 0, 180.2169342041);
CreateDynamicObject(987, 1165.0999755859, 1362.8000488281, 13.699999809265, 0, 0, 180.21423339844);
CreateDynamicObject(9324, 1106.3000488281, 1349, 16, 0, 0, 90.5);
CreateDynamicObject(9324, 1106.3000488281, 1323, 16, 0, 0, 90.499877929688);
CreateDynamicObject(9324, 1106.3000488281, 1297, 16, 0, 0, 90.499877929688);
CreateDynamicObject(9324, 1168.4000244141, 1321.0999755859, 16, 0, 0, 270.49987792969);
CreateDynamicObject(9324, 1168.4000244141, 1295.0999755859, 16, 0, 0, 270.49438476563);
CreateDynamicObject(8168, 1150.6999511719, 1359.6999511719, 11.699999809265, 0, 0, 287);
CreateDynamicObject(8650, 1124, 1362.8000488281, 10.89999961853, 0, 0, 90);
CreateDynamicObject(8650, 1124, 1362.8000488281, 13.10000038147, 0, 0, 90);
CreateDynamicObject(8650, 1124, 1362.8000488281, 14.199999809265, 0, 0, 90);
CreateDynamicObject(987, 1139.0999755859, 1362.9000244141, 15.199999809265, 0, 0, 179.74731445313);
OBJECT = CreateObject(969, 1139.4000244141, 1362.8000488281, 9.6999998092651, 0, 0, 0);

company1 = CreateObject(969, 1357.4000244141, 717.59997558594, 9.8000001907349, 0, 0, 269.5);

pickup1 = CreatePickup(1247, 23, 1168.3235,1363.9564,10.8203);
pickup2 = CreatePickup(1247, 23, 1164.7401, 1343.8209, 10.8125);

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 OnPlayerPickUpPickup(playerid, pickupid)
{



 if ( P_DATA[ playerid ][ Vip ] >= 1 )
   if(pickupid == pickup1)//Here is our pickup the pickup1
    {
 SetPlayerPos(playerid, 1160.1116,1344.3009,10.8125); //Here is the functions we will use!!
 SendClientMessage(playerid, 0xFF5500AA, "Welcome to the vip area");
 }
 

 if ( P_DATA[ playerid ][ Vip ] >= 1 )
 if(pickupid == pickup2)//Here is our pickup the pickup1
    {
 SetPlayerPos(playerid, 1138.1554, 1364.2006, 10.7938); //Here is the functions we will use!!
 SendClientMessage(playerid, 0xFF5500AA, "You have left the vip area");
    }
   
    return 1;
    }
   

// Good we are done no





public OnPlayerDisconnect( playerid, reason )
{
    AdminDuty[playerid] = 0;
    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, ispassenger)
{

    return 1;
}
   

public OnPlayerStateChange( playerid, newstate, oldstate )
{
    new vehicleid = GetPlayerVehicleID(playerid);

    if(newstate == PLAYER_STATE_DRIVER) // Player entered as a driver
    {
        if (GetVehicleModel(vehicleid) == 406 && P_DATA[ playerid ][ Vip ] == 0) // 406 dumper
        {
        SendClientMessage(playerid, -1,"{ff0000}Only VIP members can use this vehicle - become VIP to get more benefits.");
        RemovePlayerFromVehicle(playerid);
        }
   
    return 1;
}
 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;
}

   

   
//================================================================================================================================//
//======================================================== [ Commands v1.0 ] =====================================================//




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!" );
   
    if ( level == 0 )
    {
        P_DATA[ giveplayerid ][ Vip ] = level;
        format( Query, sizeof( Query ), "DELETE FROM `Vips` WHERE `Nume` = '
%s'" , PlayerName2( giveplayerid ) );
        db_free_result( db_query( Database, Query ) );
        format( string, sizeof( string ), "Administrator %s has deleted you V.I.P account!", PlayerName2( playerid ) );
        return SendClientMessage( giveplayerid, ABLUE, string );
       
    }

    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` VALUES('
%s','%d','%d')", PlayerName2( giveplayerid ), level, -1 );
        db_free_result( db_query( Database, Query ) );
    } else {
        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 ), "UPDATE `Vips` SET `VipLevel` = '
%d' WHERE `Nume` = '%s'", level, PlayerName2( giveplayerid ) );
        db_free_result( db_query( Database, Query ) );

    }
    return 1;
}
CMD:vcmds( playerid, params[ ] )
{
    new string[ 1024 ];

    if ( P_DATA[ playerid ][ Vip ] >= 1 )
    {
        strcat( string, "{FF0000}Level 1 Commands\n{FFFFFF}/MYTIME,/MYWEATHER,/MYCOLOR,/VSPEC,/VSPECOFF,/VIPAREA,/LTC[1-13,/VCAR,/VNOS\n {00FF00}Level 2 Commands\n{FFFFFF}/VIPGOTO,/VSAVESKIN,/VASAY\n{0000ff}Level 3 Commands\n {FFFFFF}/VANNOUNCE,/VGET,/VKICK\n{ffff00}use ! infront of your message for vip chat" );
        ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P Commands:", string, "Quit", "" );
        // #if defined VIPS_SEND_COMMAND
        //// SendVipsCommand( playerid, "/vcmds" );
        // #endif
    } else {
        return SendLevel( playerid, 1 ); }
    return 1;
}
CMD:vips( playerid, params[ ] )
{
    new V, vstr[ 2048 ]; // I put big string to apeear all V.I.Ps

    for ( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerConnected( i ) && P_DATA[ i ][ Vip ] > 0 )
        {
            format( vstr, 2048, "{FF5500}%s\n{FF5500}V.I.P {00FF00}%s {FF5500}- Level {00FF00}%d", vstr, ReturnPlayerName( i ), P_DATA[ i ][ Vip ] );
            V++;
        }
    }
    if ( V == 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:mytime( playerid, params[ ] )
{
    new time, string[ 128 ];

    if ( P_DATA[ playerid ][ Vip ] >= 1 )
    {
        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
    } else {
        return SendLevel( playerid, 1 ); }
    return 1;
}
CMD:vasay( playerid, params[ ] )
{
    new VipMessage[ 180 ];

    if ( P_DATA[ playerid ][ Vip ] >= 2 )
    {
        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
    } else {
        return SendLevel( playerid, 2 ); }
    return 1;
}
CMD:viparea( playerid, params[ ] )
{
    if ( P_DATA[ playerid ][ Vip ] >= 1 )
    {
        SetPlayerPos( playerid, 1131.0050,1244.7603,10.8203 );
       
        RemovePlayerFromVehicle( playerid );
        // #if defined VIPS_SEND_COMMAND
        // SendVipsCommand( playerid, "/viparea" );
        // #endif
        SendClientMessage( playerid, COLOR_VIP, "You have teleported to V.I.P Area");
    } else {
        return SendLevel( playerid, 1 ); }
    return 1;
}
CMD:scopen(playerid, params[])
{
    MoveObject(company1, 1357.4000244141, 717.59997558594, 6.3000001907349,  10.00);
    SendClientMessage( playerid, COLOR_RED, "Welcome To Lv Car And Scrap Yard");
       SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds

      return 1;
}
CMD:vipgate(playerid, params[])
{
if ( P_DATA[ playerid ][ Vip ] >= 1 )
        MoveObject(OBJECT, 1139.4000244141, 1362.8000488281, 6.3000001907349,  10.00);
       SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
       
      return 1;
    }
CMD:vnos( playerid, params[ ] )// V.I.Ps Special Actions( Holds + Jetpack! )
{
    if ( P_DATA[ playerid ][ Vip ] >= 1 )
    {
        if (GetPlayerVehicleSeat(playerid) == 0)
            {

                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); // Add nitro to the player'
s vehicle
                    SendClientMessage( playerid, COLOR_VIP, "You have used Your Vip Power To Add Nos");
                    return 1;
            }
        }
    }
   


//================================================================================================================================//
//====================================================== [ public's ] ============================================================//


Public: SendLevel( playerid, level )
{
    if ( level == 1 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P Level 1 or Higher to use this command" );
    if ( level == 2 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P Level 2 or Higher to use this command" );
    if ( level == 3 ) return SendClientMessage( playerid, RED, "ERROR: You need to be V.I.P Level 3 to use this command");
    return 1;
}
public close()
{
    MoveObject(OBJECT,1139.4000244141, 1362.8000488281, 9.6999998092651, 10.00);
    MoveObject(company1,1357.4000244141, 717.59997558594, 9.8000001907349, 10.00);
   
    return 1;
}

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;
}

Public: ReturnPosition( playerid )
{
    SetPlayerPos( playerid, Position[ playerid ][ 0 ], Position[ playerid ][ 1 ], Position[ playerid ][ 2 ] );
    SetPlayerFacingAngle( playerid, Position[ playerid ][ 3 ] );
}

Public: GodUpdate( )
{
    for ( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerConnected( i ) && P_DATA[ i ][ God ] == 1 )
        {
            SetPlayerHealth( i, 100000 );
        }
        if ( IsPlayerConnected( i ) && P_DATA[ i ][ CarGod ] == 1 && IsPlayerInAnyVehicle( i ) )
        {
            SetVehicleHealth( GetPlayerVehicleID( i ), 10000 );
        }
    }
}
//======================================================== [ Stocks ] ============================================================//
stock LockVehicle(vehicleid) {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
    return 1;
}
stock UnlockVehicle(vehicleid) {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
    return 1;
}
stock PlayerName2( i ){
    new n[ 24 ];
    GetPlayerName( i, n, 24 );
    return n;
}
stock ReturnPlayerName( id )
{
    new tehname[ MAX_PLAYER_NAME ];
    GetPlayerName( id, tehname, sizeof( tehname ) );
    return tehname;
}
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 str[ 128 ];

    format( str, sizeof( str ),"[V.I.P] {00FF00}%s(%d) {FF5500}has used command {00FF00}%s", PlayerName2( playerid ), playerid, cmdtext );
    return SendVipMessage( COLOR_VIP, str );
}
// #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;
}



//============================================================ [ EOF ] ===========================================================//
Reply
#2

Mhm, why dont you
pawn Код:
P_DATA[ giveplayerid ][ Vip ] = level
When they reach 200scores.
you want them to use all the features VIPs has, right?
Reply
#3

yes but i also want it to say that they have reached 200 score to everyone
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)