Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Need help in a command

$
0
0
I'm trying to make a command so the player can find his doors but when I use the command it only shows the first door
Code:

CMD:mydoors(playerid, params[])
{
        new string[128],id1,id2,id3;
        id1 = PlayerInfo[playerid][pDoor1];
        id2 = PlayerInfo[playerid][pDoor2];
        id3 = PlayerInfo[playerid][pDoor3];
        if(PlayerInfo[playerid][pDoor1] == -1 && PlayerInfo[playerid][pDoor2] == -1 && PlayerInfo[playerid][pDoor3] == -1) return SCM(playerid,COLOR_WHITE, "You do not own any doors");
        if(PlayerInfo[playerid][pDoor1] >= 0 )
        {
                format(string,sizeof(string), "Door ID: %d | Description: %s", id1, DDoorsInfo[id1][ddDescription]);
                  SCM(playerid,COLOR_WHITE, string);
        }
        else if(PlayerInfo[playerid][pDoor2] >= 0 )
        {
                format(string,sizeof(string), "Door ID: %d | Description: %s", id2, DDoorsInfo[id2][ddDescription]);
                  SCM(playerid, COLOR_WHITE, string);
        }
        else if(PlayerInfo[playerid][pDoor3] >= 0)
        {
                format(string,sizeof(string), "Door ID: %d | Description: %s", id3, DDoorsInfo[id3][ddDescription]);
                  SCM(playerid, COLOR_WHITE, string);
        }
        return 1;
}

How to fix it?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>