SA-MP Forums Archive
Help with command - 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: Help with command (/showthread.php?tid=629044)



Help with command - nemanjasepa - 19.02.2017

I am trying to make command /givepackage [playerid] [slot(1-12)] which will first check if player who is giving package has something on slot he wrote in cmd, and then give that package to first empty slot on giveplayerid.. I got one idea, but it will took 2 years to make that because its around 12000 lines...


Re: Help with command - nemanjasepa - 19.02.2017

I am in need of function to get first empty slot..


Re: Help with command - JaydenJason - 19.02.2017

How do you expect us to help you if you don't have code?

PHP код:
IsSlotEmpty(playeridindex) {
    switch(
index) {
        case 
1: return plyInfo[playerid][pSlot1] == 0;
        case 
2: return plyInfo[playerid][pSlot2] == 0;
        case 
3: return plyInfo[playerid][pSlot3] == 0;
        case 
4: return plyInfo[playerid][pSlot4] == 0;
        case 
5: return plyInfo[playerid][pSlot5] == 0;
        case 
6: return plyInfo[playerid][pSlot6] == 0;
        default: return 
false;
    }

Something like this


Re: Help with command - nemanjasepa - 19.02.2017

Thanks, I will try this


Re: Help with command - nemanjasepa - 19.02.2017

I am getting warning function "IsSlotEmpty" should return a value


Re: Help with command - Bolex_ - 19.02.2017

You should return it


Re: Help with command - nemanjasepa - 19.02.2017

I fixed everything after trying a lot of different things...