Problem with a cmd
#1

Hi guys I am creating a cmd

that is so

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/startbase", cmdtext, true, 10) == 0)
    {
    if (IsPlayerAdmin(playerid))       
    ShowPlayerDialog(playerid,14041,DIALOG_STYLE_LIST,"{FF0000}Inicia una Base ","\n{00c4fa}Base: {ff0000}1 ","Accept","Cancel");
        return 1;
    }
    return 0;
}
in

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==14041) {
    if(response) {
    if(listitem==0) {                     // Dedfensa
    if(gTeam[playerid] == TEAM_1)
    {
        SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
        SetPlayerSkin(playerid,199);
    }
    }
    else if(gTeam[playerid] == TEAM_2)
    {
        SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
        SetPlayerSkin(playerid,199);
            }
        }
    }
    return 1;
}
That problem is the teams indicated wing position will not.

help
Reply
#2

Sencillo, remueve tle gTeams y utiliza tu skin si es restricted, asi no necesitas el gteam y solo serб por skin.
Reply
#3

This is what you have

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==14041)
    {
        if(response)
        {
            if(listitem==0)
            {                     // Dedfensa
                if(gTeam[playerid] == TEAM_1)
                {
                    SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
                    SetPlayerSkin(playerid,199);
                }
            }
            else if(gTeam[playerid] == TEAM_2)
            {
                SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
                SetPlayerSkin(playerid,199);
            }
        }
    }
    return 1;
}
This is what you must have

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==14041)
    {
        if(response)
        {
            if(listitem==0)
            {                     // Dedfensa
                if(gTeam[playerid] == TEAM_1)
                {
                    SetPlayerPos(playerid,2471.39990234,-1705.00000000,13.19999981);
                    SetPlayerSkin(playerid,199);
                }
                else if(gTeam[playerid] == TEAM_2)
                {
                    SetPlayerPos(playerid,2443.50000000,-1555.90002441,23.60000038);
                    SetPlayerSkin(playerid,199);
                }
            }
        }
    }
    return 1;
}
Fix your indentation and the problem is visible,

Test it out, second code should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)