VIP help
#1

how can i create:vip lvls,vip check and vip cmds?


P.S. How i save it all in a file?
Reply
#2

Use ******?
Reply
#3

use wiki and read the Admin system help, VIP is same idea.
Reply
#4

its simple just use : new Vip[MAX_PLAYERS];
then make a command so when u use it on a player his Vip[playerid] = 1
then just do :
public OnPlayerConnect(playerid)
{
if(Vip[playerid] == 1) return SendClientMessageToAll(COLOR_TEST,"A Vip Just Connected");
return 1;
}
Reply
#5

Lmao he mean how would he setvip and make cmds plus save vip level using dini.
Reply
#6

ok this is mine, dont copy mine just take an this idea and make your own
pawn Код:
CMD:setvip(playerid, params[])
{
    new id,vlevel,file[256];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"ui",id,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [id] [Level 1-3]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!");
    if(vlevel == 0)
    {
        if(PlayerData[id][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 0!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String,sizeof(String),"You had set %s VIP Level to 0!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 0);
        PlayerData[id][vip] = 0;
        PlayerData[playerid][vip] = 0;
        PlayerData[id][vip] = 0;
    }
    if(vlevel == 1)
    {
        if(PlayerData[id][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 1 (BRONZE VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 1);
        PlayerData[id][vip] = 1;
        PlayerData[playerid][vip] = 1;
        PlayerData[id][vip] = 1;
    }
    if(vlevel == 2)
    {
        if(PlayerData[id][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 2 (SILVER VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 2 (SILVER VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 2);
        PlayerData[id][vip] = 2;
        PlayerData[playerid][vip] = 2;
        PlayerData[id][vip] = 2;
    }
    if(vlevel == 3)
    {
        if(PlayerData[id][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 3 (GOLD VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 3 (GOLD VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 3);
        PlayerData[id][vip] = 3;
        PlayerData[playerid][vip] = 3;
        PlayerData[id][vip] = 3;
    }
    return 1;
}
Reply
#7

What about VIP cmd?

Anyways Good Code Though.
Reply
#8

ugh ill give one
pawn Код:
CMD:ccolor(playerid, params[])
{
    if(PlayerData[playerid][vip] > 0)// if it is over 0!
    {
        new cc1,cc2, string[256];
        if(sscanf(params,"dd",cc1,cc2)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /ccolor [color1] [color2]");
        ChangeVehicleColor(GetPlayerVehicleID(playerid), cc1, cc2);
        format(string, sizeof(string), "You changed your first color to %d and second colour %d!", cc1, cc2);
        SendClientMessage(playerid,0xFF9900AA,string);
        }
        else return SendClientMessage(playerid,0xFF0000FF,"ERROR: You are not an vip!");
        return 1;
}
Reply
#9

Nice!
Reply
#10

Quote:
Originally Posted by tanush
Посмотреть сообщение
ok this is mine, dont copy mine just take an this idea and make your own
pawn Код:
CMD:setvip(playerid, params[])
{
    new id,vlevel,file[256];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"ui",id,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [id] [Level 1-3]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
    if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!");
    if(vlevel == 0)
    {
        if(PlayerData[id][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 0!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String,sizeof(String),"You had set %s VIP Level to 0!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 0);
        PlayerData[id][vip] = 0;
        PlayerData[playerid][vip] = 0;
        PlayerData[id][vip] = 0;
    }
    if(vlevel == 1)
    {
        if(PlayerData[id][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 1 (BRONZE VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 1);
        PlayerData[id][vip] = 1;
        PlayerData[playerid][vip] = 1;
        PlayerData[id][vip] = 1;
    }
    if(vlevel == 2)
    {
        if(PlayerData[id][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 2 (SILVER VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 2 (SILVER VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 2);
        PlayerData[id][vip] = 2;
        PlayerData[playerid][vip] = 2;
        PlayerData[id][vip] = 2;
    }
    if(vlevel == 3)
    {
        if(PlayerData[id][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!");
        GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        format(String, sizeof(String),"%s has set your VIP Level to 3 (GOLD VIP)!",Name);
        SendClientMessage(id,0xFF9900AA,String);
        format(String, sizeof(String),"You had set %s VIP Level to 3 (GOLD VIP)!",pname);
        SendClientMessage(playerid,0xFF9900AA,String);
        dini_IntSet(file,"VIP", 3);
        PlayerData[id][vip] = 3;
        PlayerData[playerid][vip] = 3;
        PlayerData[id][vip] = 3;
    }
    return 1;
}
this script give me those errors:
Код:
C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 029: invalid expression, assumed zero
C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 017: undefined symbol "cmd_setvip"
C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 029: invalid expression, assumed zero
C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : fatal error 107: too many error messages on one line

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


4 Errors.
(line 94:CMDetvip(playerid, params[]))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)