SA-MP Forums Archive
how do I get "IsPlayerVip" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how do I get "IsPlayerVip" (/showthread.php?tid=463977)



how do I get "IsPlayerVip" - ExtendedCarbon - 14.09.2013

I want it for my server, I don't know if it's a vip system or something, I need to know how to make a command that checks for VIP's thanks. Also I have no way of setting someone to VIP so how do I do that too thanks


Re: how do I get "IsPlayerVip" - Konstantinos - 14.09.2013

pawn Код:
new
    bool: VIP[ MAX_PLAYERS ]
;

public OnPlayerConnect( playerid )
{
    VIP[ playerid ] = false;
    return 1;
}

CMD:setvip( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You need to be RCON" );
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /setvip <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "That player is not online" );
    if( IsPlayerVip( id ) ) return SendClientMessage( playerid, -1, "That player is already VIP" );
   
    VIP[ id ] = true;
    // possibly some messages that he's now a VIP
    return 1;
}

CMD:removevip( playerid, params[ ] )
{
    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You need to be RCON" );
    new
        id
    ;
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /setvip <ID/Part Of Name>" );
    if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "That player is not online" );
    if( !IsPlayerVip( id ) ) return SendClientMessage( playerid, -1, "That player is not VIP" );

    VIP[ id ] = false;
    // possibly some messages that he's now demoted and he's no longer a VIP member
    return 1;
}

stock IsPlayerVip( playerid )
{
    if( VIP[ playerid ] ) return 1;
    return 0;
}
You need to save it and load it when a player login to their account.