Help for creating a VIP commands
#1

Hello all, i want to creat a VIp commands, and only vip can Do the Commands
if is SILVER:
Weapons whene he spawns:
# mini-gun 50 ammo
# sniper 25 ammo
# M4 250 ammo
# can spray 400 ammo
# desert egal 200 ammo
# dual sawnoff 70
# dual uzi 150 ammo
Cmds:
/healme to heal the player
/getarmour give him an armour
/mob to spawn a baril

if GOLD:
Weapons whene he spawns:
# mini-gun 100 ammo
# sniper 50 ammo
# M4 550 ammo
# can spray 600 ammo
# desert egal 500 ammo
# dual sawnoff 120
# 10 molotves
# dual uzi 300
Cmds:
/mob to spawn the baril
200$ for each spawn

Please Help me, i know this take a long time but if u know a tread or u can make the code, or a bit of this script please help me^^
Reply
#2

This is the wrong place to ask. Go and check out the Script Request Thread.

And this would be quite simple. Create a variable to store a player's VIP status, and change it to set it. Use OnPlayerSpawn to check the variable to the different levels, and if they have that status, Use GivePlayerWeapon to give them the weapons. And the commands are extremely simple to create, look at SetPlayerHealth, SetPlayerArmour, GivePlayerMoney and CreateVehicle.

For some reason, I don't think your name suits you.
Reply
#3

Filterscript:
pawn Код:
// Add the saving system yourself, I am just going to do vars + commands + spawn weapons and money.

#include < a_samp >
#include < zcmd > // You need ZCMD for this.
#include < sscanf2 > // You also need SSCANF2 include + plugin for this.

#define VIP_SILVER 1
#define VIP_GOLD   2

CMD:setvip( playerid, params[ ] ) {
    if( !IsPlayerAdmin( playerid ) )
        return SendClientMessage( playerid, -1, "You need to be a RCON admin to use this. " ); // You need to be RCON to set someone's VIP
    new
        id,
        vip
    ;
    if( sscanf( params, "ud", id, vip ) )
        return SendClientMessage( playerid, -1, "USAGE: /setvip [ID] [1 for silver, 2 for gold, 0 if you want to remove VIP]. " );
    if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID )
        return SendClientMessage( playerid, -1, "Invalid player ID (player not connected). " );
    if( vip > 2 || vip < 0 )  
        return SendClientMessage( playerid, -1, "The VIP rank must be between 0 and 2. " );
    SetPVarInt( id, "VIP", vip );
    new
        str[ 128 ],
        pName[ 24 ],
        aName[ 24 ],
        vipstr[ 8 ]
    ;
    if( vip == 0 )
        vipstr = "none";
    if( vip == 1 )
        vipstr = "silver";
    if( vip == 2 )
        vipstr = "gold";
    GetPlayerName( id, pName, 24 );
    GetPlayerName( playerid, aName, 24 );
    format( str, sizeof str, "RCON administrator %s has set your donor rank to %s", aName, vipstr );
    SendClientMessage( id, -1, str );
    format( str, sizepf str, "You have set %s's donor rank to %s", pName, vipstr );
    return SendClientMessage( playerid, -1, str );
}

CMD:healme( playerid, params[ ] ) {
    if( GetPVarInt( playerid, "VIP" ) < 1 )
        return SendClientMessage( playerid, -1, "You need to be VIP silver/gold to use this. " );
    SetPlayerHealth( playerid, 100.0 );
    return SendClientMessage( playerid, -1, "You healed yourself. " );
}

CMD:getarmour( playerid, params[ ] ) {
    if( GetPVarInt( playerid, "VIP" ) < 1 )
        return SendClientMessage( playerid, -1, "You need to be VIP silver/gold to use this. " );
    SetPlayerArmour( playerid, 100.0 );
    return SendClientMessage( playerid, -1, "You armoured yourself. " );
}


public OnPlayerSpawn( playerid ) {
    switch( GetPVarInt( playerid, "VIP" ) ) {
        case VIP_SILVER: {
            GivePlayerWeapon( playerid, 38, 50 );
            GivePlayerWeapon( playerid, 34, 25 );
            GivePlayerWeapon( playerid, 31, 250 );
            GivePlayerWeapon( playerid, 41, 400 );
            GivePlayerWeapon( playerid, 24, 200 );
            GivePlayerWeapon( playerid, 26, 70 );
            GivePlayerWeapon( playerid, 28, 150 );
        }
        case VIP_GOLD: {
            GivePlayerWeapon( playerid, 38, 100 );
            GivePlayerWeapon( playerid, 34, 50 );
            GivePlayerWeapon( playerid, 31, 550 );
            GivePlayerWeapon( playerid, 41, 600 );
            GivePlayerWeapon( playerid, 24, 500 );
            GivePlayerWeapon( playerid, 26, 120 );
            GivePlayerWeapon( playerid, 28, 300 );
            GivePlayerWeapon( playerid, 18, 10 );
            GivePlayerMoney( playerid, 200 );
        }
    }
    return 1;
}

public OnPlayerDisconnect( playerid ) {
    DeletePVar( playerid, "VIP" );
}
Untested, note that I worked around 20 minutes on this. Also, I didn't add "/mob" because I don't know what a baril is...

You need to add saving system yourself to save player's VIP to file.
Reply
#4

Thank you Very Much Mean !! i'm so sorry if it is very long for you sorry sorry, but Thank's thank's Thank's !!
Reply
#5

Hello Mean !
ok whene i complie i've got 4 errors:
Код:
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : error 017: undefined symbol "sizepf"
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : warning 215: expression has no effect
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : warning 215: expression has no effect
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : warning 215: expression has no effect
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : warning 215: expression has no effect
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : error 029: invalid expression, assumed zero
C:\DOCUME~1\PC\Bureau\ZOMBIE~1\FILTER~1\VIP.pwn(40) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Change this
pawn Код:
format( str, sizepf str, "You have set %s's donor rank to %s", pName, vipstr );
To this
pawn Код:
format( str, sizeof str, "You have set %s's donor rank to %s", pName, vipstr );
Reply
#7

Thank you Wesley221! it is working 100% without errors! thank's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)