SA-MP Forums Archive
Will this work? Getting Dildo Unused Slot - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Will this work? Getting Dildo Unused Slot (/showthread.php?tid=487561)



Will this work? Getting Dildo Unused Slot - ToiletDuck - 14.01.2014

this will get the Unused Slot for Dildos, for example
pawn Код:
new DildoSlot = GetDildoFreeSlot(id);

if(DildoSlot == -1) return SCM(playerid, -1, "You can't have more dildos");
Dildo[id][DildoSlot][dID] =1;
pawn Код:
stock GetDildoFreeSlot(id) {
    if(Dildo[id][Size] == 1) {
        for(new i; i < MAX_DILDO_SMALL; ++i) {
            if(Dildo[id][i][dID] == INVALID_DILDO_ID) return i;
        }
    }
    else if(Dildo[id][Size] == 2) {
        for(new i; i < MAX_DILDO_MEDIUM; ++i) {
            if(Dildo[id][i][dID] == INVALID_DILDO_ID) return i;
        }
    }
    else if(Dildo[id][Size] == 3) {
        for(new i; i < MAX_DILDO_LARGE; ++i) {
            if(Dildo[id][i][dID] == INVALID_DILDO_ID) return i;
        }
    }
    return -1;
}