17.03.2018, 22:14
(
Последний раз редактировалось MafiaOink; 17.03.2018 в 22:16.
Причина: Forgot to write my actual problem
)
I've been trying to implement sub commands inside a command, I've tried using strcmp and strfind for it but they dont seem to work.
I'm using I-ZCMD, sscanf.
Error:
Commands:
I'm using I-ZCMD, sscanf.
Код:
new cmd[128]; if(sscanf(params, "s[128]", cmd)) return SFM(playerid, COLOR_GREY, "[USAGE] vtrunk (option)"), SFM(playerid, COLOR_GREY, "[OPTIONS] view take put"); if(strfind(cmd, "view") == 0) { new count = 0; SFM(playerid, COLOR_GREY, "Trunk Items"); for(new x = 0; x < 5; x++) { //getitems pass = count++ and print else nothing } if(count == 0) SFM(playerid, COLOR_YELLOWGREEN, "No items found in trunk."); count = 0; SFM(playerid, COLOR_GREY, "Trunk Weapons"); for(new x = 0; x < 5; x++) { //getweapons pass = count++ and print else nothing } if(count == 0) SFM(playerid, COLOR_YELLOWGREEN, "No weapons found in trunk."); } else if(strfind(cmd, "take") == 0) { new cmdex[128]; if(sscanf(cmd, "s[128]", cmdex)) return SFM(playerid, COLOR_GREY, "[USAGE] vtrunk take (weapon/item)"); if(strfind(cmdex, "weapon") == 0) { SFM(playerid, COLOR_GREY, "Under Construction!"); } else if(strfind(cmdex, "item") == 0) { //under construncton } else { SFM(playerid, COLOR_GREY, "[USAGE] vtrunk take (weapon/item)"); } } else if(strfind(cmd, "put") == 0) { new cmdex[128]; if(sscanf(cmd, "s[128]", cmdex)) return SFM(playerid, COLOR_GREY, "[USAGE] vtrunk put (weapon/item)"); if(strfind(cmdex, "weapon") == 0) { SFM(playerid, COLOR_GREY, "Under Construction!"); } else if(strfind(cmdex, "item") == 0) { //under construncton } else { SFM(playerid, COLOR_GREY, "[USAGE] vtrunk take (weapon/item)"); } } else { return 1; }
Код:
[03:05:36] [USAGE] vtrunk take (weapon/item) [03:05:45] [USAGE] vtrunk put (weapon/item)
Код:
/vtrunk take (and now anything that falls under this) /vtrunk put (and now anything that falls under this)