18.06.2013, 22:31
So I've come to make a new option for the command /famedit. Now whenever I try to confirm my HQ location, it tells me invalid option. What's wrong in this function?
Код:
else if(!strcmp(option, "HQ", true, 4)) { new confirm[8]; if(PlayerInfo[playerid][pFamRank] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(FamInfo[idx][fHqX] != 0 && FamInfo[idx][fHqY] != 0 && FamInfo[idx][fHqZ] != 0) { // SSCANF Check if(sscanf(params, "s[32]s[8]", option, confirm)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /famedit HQ [confirm]"); SendClientMessage(playerid, COLOR_LIGHTRED, " Changing your family's Headquarters location will cost $100,000."); return 1; } // Confirm Check if(strcmp(confirm, "confirm", true, 8)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /famedit HQ [confirm]"); SendClientMessage(playerid, COLOR_LIGHTRED, " Changing your family's Headquarters location will cost $100,000."); return 1; } // Money Check if(PlayerInfo[playerid][pMoney] < 100000) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money on you. ($100,000)"); GiveDodMoney(playerid, -100000); } GetPlayerPos(playerid,FamInfo[idx][fHqX], FamInfo[idx][fHqY], FamInfo[idx][fHqZ]); DestroyDynamicPickup(FamInfo[idx][fPickup]); FamInfo[idx][fPickup] = CreateDynamicPickup(1239, 1, FamInfo[idx][fHqX], FamInfo[idx][fHqY], FamInfo[idx][fHqZ], -1); DestroyDynamic3DTextLabel(FamInfo[idx][fText]); format(string, sizeof(string), "%s's Headquarters", FamInfo[idx][fName]); FamInfo[idx][fText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, FamInfo[idx][fHqX], FamInfo[idx][fHqY], FamInfo[idx][fHqZ]+0.3, 15); SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have set your family's HQ location."); }