Help with /changeteam
#1

Hello all. I made a /changegang command but is bullshit.
Everytime when i type that, my gang is not changing and when i select a gang for changing, it's shows me a dialog_box from login system
anyone can help me with this command?
Reply
#2

show the lines LOL
Reply
#3

This is ondialogresponse. here is the problem
pawn Код:
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                 if(PlayerInfo[playerid][pTeam] == 0)
                 {
                 SetPlayerTeam(playerid, 1);
                 SpawnPlayer(playerid);
                }
                case 1: // The second item listed
                {
                    if(PlayerInfo[playerid][pTeam] == 1)
                 {
                 SetPlayerTeam(playerid, 0);
                 SpawnPlayer(playerid);
                }
            }
            }
    }
    }
Reply
#4

If sometimes it show Login Dialog then dialog ids are conflicting with each other...
Reply
#5

Oh...i try to fix that but, why my gang is not changing where is the problem>?
Reply
#6

pawn Код:
CMD:changeteam(playerid, params[])
{
    ForceClassSelection(playerid);
    SetPlayerHealth(playerid, 0.0);
    return 1;
}

CMD:changegang(playerid, params[])
{
    return cmd_changeteam(playerid, params[]);
}
OffTopic: Please learn to indent your code (How to use TABs)
Reply
#7

you were probably checking player team on spawn and you didnt update PlayerInfo:

pawn Код:
if(response)// They pressed the first button.
{
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
    {
        case 1:// Our dialog!
        {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                    if(PlayerInfo[playerid][pTeam] == 0)
                    {
                        SetPlayerTeam(playerid, 1);
                        PlayerInfo[playerid][pTeam] = 1;
                        SpawnPlayer(playerid);
                    }
                }
                case 1: // The second item listed
                {
                    if(PlayerInfo[playerid][pTeam] == 1)
                    {
                        PlayerInfo[playerid][pTeam] = 0;
                        SetPlayerTeam(playerid, 0);
                        SpawnPlayer(playerid);
                    }
                }
            }
        }
    }
Reply
#8

Dziugas thx. i will try that now. BTW i fix the problem with dialogs id
I will reply with the answer. if is good or nah.
Reply
#9

THX a lot dziugas respect man
Reply
#10

Glad i helped.(You dont see that very often DDDD).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)