19.06.2013, 04:26
Anybody know the issue? Here's the code again.
Error: It sends me the words "Invalid Option" and dosen't place the Pickup.
pawn Код:
else if(!strcmp(option, "HQ", true, 4))
{
new confirm[7];
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[7]", 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, 7)==0)
{
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.");
}