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

How do i add more skins slots?

$
0
0
I was looking deeply in this code trying to update organization skins up to 5.But i couldn't do it..always giving 3 skins max like it was before.Please help out.Thanks in advance.
Code:

CMD:orgskins(playerid, params[])
{
        new orgid, skin1, skin2, skin3, string[256];
        if (adlvl[playerid] < 6) return 0;
        if (sscanf(params, "dd", orgid, skin1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /orgskins [orgid] [skin1] [skin2] [skin3]");
        sscanf(params, "ddd", orgid, skin1, skin2);
        sscanf(params, "dddd", orgid, skin1, skin2, skin3);
        format(string, 10, "org%d", orgid);
        if (!dini_Exists(AddDirFile(dir_orgfiles, string))) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid organization id.");
        if (skin1 < 0 || skin1 > 299 || skin1 == 74 || skin2 < 0 || skin2 > 299 || skin2 == 74 || skin3 < 0 || skin3 > 299 || skin3 == 74 || skin1 == 0 || (skin2 == 0 && skin3 != 0)) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid skin id.");
        dini_IntSet(AddDirFile(dir_orgfiles, string), "skin1", skin1);
        dini_IntSet(AddDirFile(dir_orgfiles, string), "skin2", skin2);
        dini_IntSet(AddDirFile(dir_orgfiles, string), "skin3", skin3);
        if (skin2 != 0)
        {
                if (skin3 != 0) format(string, sizeof(string), "%s's skins changed to %d, %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2, skin3);
                else format(string, sizeof(string), "%s's skins changed to %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2);
        }
        else format(string, sizeof(string), "%s's skins changed to %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1);
        SendClientMessage2(playerid, COLOR_SILVER, string);
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



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