Need help with this please. +Rep
#1

Hello,
I'm having a problem with this. I want it, so if a player is already level 1, 2, 3, or 4 VIP they can't use this. Here's my current code.
pawn Код:
if(dialogid == 255 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][pCookies] >= 5)
                {
                    PlayerInfo[playerid][pVip] = 4;
                    if(PlayerInfo[playerid][pVip] >= 4)
                    {
                        SetTimerEx("TempVip", 150000, false, "i", playerid);
                        new pname[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,pname,sizeof(pname));
                        new MyString[128];
                        PlayerInfo[playerid][pCookies] = PlayerInfo[playerid][pCookies] - 5;
                        format(MyString,sizeof MyString, "You are now temporary VIP Level 3 for 15 minutes.");
                        SendClientMessage(playerid, COLOR_GREEN, MyString);
                    }
                    else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You're already a VIP member.");
                }
                else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You don't have enough cookies. You need 5. You can check your cookies with /mycookies.");
            }
        }
    }
    return 1;
}
I've tried editing
pawn Код:
if(PlayerInfo[playerid][pVip]
Multiple times. It's just not working out. I've been trying for about a hour. So now I thought was time to come here.

Any help is appreciated, thanks.
Reply
#2

show me Command code..

Edit:
Код:
if(PlayerInfo[playerid][pVip] > 4) try this
Reply
#3

Quote:
Originally Posted by Sufyan
Посмотреть сообщение
show me Command code..
All the command does is show the dialog.
pawn Код:
COMMAND:cshop(playerid, params[])
{
    if(PlayerInfo[playerid][pCookies]>=2)
    {
        ShowPlayerDialog(playerid, 255, DIALOG_STYLE_LIST, "Cookies Shop.", "Temporary VIP Package. Lasts 15 minutes. (5 Cookies)", "Accept", "Exit");
    }
    else SendClientMessage(playerid, COLOR_BRIGHTRED, "You need at least 2 cookies to open the Cookies Shop.");
    return 1;
}
Reply
#4

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
Hello,
I'm having a problem with this. I want it, so if a player is already level 1, 2, 3, or 4 VIP they can't use this. Here's my current code.
pawn Код:
if(dialogid == 255 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][pCookies] >= 5)
                {
                    Pl4;
                    if(PlayerInfo[playerid][pVip] >= 4)
                    {
                        SetTimerEx("TempVip", 150000, false, "i", playerid);
                        new pname[MAX_PLAYER_NAME];
                        GetPlayerName(playerid,pname,sizeof(pname));
                        new MyString[128];
                        PlayerInfo[playerid][pCookies] = PosterIori[playerid][pCookies] - 5;
I                       format(MyString,sizeof MyString, "You are now temporary VIP Level 3 for 15 minutes.");
                        SendClientMessage(playerid, COLOR_GREEN, MyString);
                    }
                    else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You're already a VIP member.");
                }
                else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You don't have enough cookies. You need 5. You can check your cookies with /mycookies.");
            }
        }
    }
    return 1;
}
I've tried editing
pawn Код:
if(PlayerInfo[playerid][pVip]
Multiple times. It's just not working out. I've been trying for about a hour. So now I thought waso time to come here.
I
Any help is appreciated, thanks.
I think it is cuz u r setting pvip = 4 if player have cookies => 5 which make player VIP lvl 4....... But not tmp VIP.

pawn Код:
PlayerInfo[playerid][pVip] = 4;
This makes player VIP lvl 4.... Remove this liNe
Reply
#5

Luke I fixed it get on hamachi rofl and look!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)