#1

Hello. I make my VIP FS. But when I type /rcon login and /setvip for another player, it happends nothing.

pawn Код:
dcmd_setvip(playerid, params[])
{
    new id,vip;
    if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,red,"ERROR: Nisi Admin da bi koristili ovu Komandu.");
    if(sscanf(params,"ui", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");//VIP 1= Premium 2=Silver 3=GOLD
    if(vip > 3)return SendClientMessage(playerid,red,"ERROR: Imaju samo 3 VIP Level-a.");
    if(vip == 1)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        format(String, sizeof(String), "INFO: Administrator %s vam je stavio Premium VIP Level.",Name);
        SendClientMessage(id,green, String);
        if(!dini_Exists(PFile(playerid)))
        {
            dini_Create(PFile(playerid));
            dini_IntSet(PFile(playerid),"VipMember",1);
        }
        else if(dini_Exists(PFile(playerid)))
        {
            dini_IntSet(PFile(playerid),"VipMember",1);
        }
        GivePlayerMoney(playerid, 500000);
    }
    if(vip == 2)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        format(String, sizeof(String), "INFO: Administrator %s vam je stavio Silver VIP Level.",Name);
        SendClientMessage(id,green, String);
        if(!dini_Exists(PFile(playerid)))
        {
            dini_Create(PFile(playerid));
            dini_IntSet(PFile(playerid),"VipMember",2);
        }
        else if(dini_Exists(PFile(playerid)))
        {
            dini_IntSet(PFile(playerid),"VipMember",2);
        }
        GivePlayerMoney(playerid, 1000000);
    }
    if(vip == 3)
    {
        GetPlayerName(playerid, Name, sizeof(Name));
        format(String, sizeof(String), "INFO: Administrator %s vam je stavio Gold VIP Level.",Name);
        SendClientMessage(id,green, String);
        if(!dini_Exists(PFile(playerid)))
        {
            dini_Create(PFile(playerid));
            dini_IntSet(PFile(playerid),"VipMember",3);
        }
        else if(dini_Exists(PFile(playerid)))
        {
            dini_IntSet(PFile(playerid),"VipMember",3);
        }
        GivePlayerMoney(playerid, 2000000);
    }
    return 1;
}
Help pls..... +rep
Reply
#2

Try to replace line
pawn Код:
if(sscanf(params,"ui", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");
to
pawn Код:
if(sscanf(params,"ud", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");
Reply
#3

Nothing ...
Reply
#4

SendClientMessage(id,green, String);

This will send a message to the id you've typed.

I've noticed you're using playerid for the rest of things which would set them to the player performing the command, you should revise your code.
Reply
#5

Can anyone make me the command ?

I can not more. When a type /setvip to another player, nothings happen.

Please
Reply
#6

Do you make sure that the playerid you trying to use in /setvip is connected?
Reply
#7

I send you the FS on pm
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)