SSCANF Problem..
#1

Well for some reason when i run my /editfaction command lets say /editfaction 1 Exterior it moves the exterior but fails to do anything else, This does not affect any other commands (like it has before with my-self) but it's some-what depressing when you've gone over it too many times.

pawn Код:
COMMAND:editfaction(playerid, params[], factionid, name[], value[])
{
    if(IsPlayerConnected(playerid))
    {
        if(HasCharacterSpawned[playerid])
        {
            if(AccountInfo[playerid][AccountStaffRank] > 0)
            {
                if(AccountInfo[playerid][EnteredStaffPassword] == false) return CreateErrorMessage(playerid,"Please enter your staff password, to use any administrive commands. (/account staff)");
                if(sscanf(params,"ds[15]S()[100]", factionid, name, value)) return CreateUsageMessage(playerid, "/editfaction [faction id] [name] [optional value]");
                if(FactionInfo[factionid][FactionSlotUsed] == 0) return CreateErrorMessage(playerid, "This faction slot is currently not in use, please specify another.");

                if(!strcmp(name, "Exterior", true))
                {
                    new Float: tmppos[3];
                    GetPlayerPos(playerid, tmppos[0], tmppos[1], tmppos[2]);
                    FactionInfo[factionid][Exterior_X] = tmppos[0];
                    FactionInfo[factionid][Exterior_Y] = tmppos[1];
                    FactionInfo[factionid][Exterior_Z] = tmppos[2];

                    new str[60];
                    format(str,sizeof(str),"[ {5F9EA0}%s{FFFFFF} ]", FactionInfo[factionid][Faction_Name]);
                    DestroyDynamicPickup(FactionInfo[factionid][Exterior_Pickup]);
                    DestroyDynamic3DTextLabel(FactionInfo[factionid][FactionLabel]);
                    FactionInfo[factionid][Exterior_Pickup] = CreateDynamicPickup(1239, 1, FactionInfo[factionid][Exterior_X], FactionInfo[factionid][Exterior_Y], FactionInfo[factionid][Exterior_Z]);
                    FactionInfo[factionid][FactionLabel] = CreateDynamic3DTextLabel(str, COLOR_WHITE, FactionInfo[factionid][Exterior_X], FactionInfo[factionid][Exterior_Y], FactionInfo[factionid][Exterior_Z]+0.4, 12);
                    CreateInfoMessage(playerid, "Faction exterior has been changed");
                }
                else if(!strcmp(name, "Title", true))
                {
                    if(strlen(value) < 1)  return CreateErrorMessage(playerid, "You must provide a Faction Name.");

                    format(FactionInfo[factionid][Faction_Name], 55, "%s", value);

                    new str[60];
                    format(str,sizeof(str),"[ {5F9EA0}%s{FFFFFF} ]", FactionInfo[factionid][Faction_Name]);
                    DestroyDynamicPickup(FactionInfo[factionid][Exterior_Pickup]);
                    DestroyDynamic3DTextLabel(FactionInfo[factionid][FactionLabel]);
                    FactionInfo[factionid][Exterior_Pickup] = CreateDynamicPickup(1239, 1, FactionInfo[factionid][Exterior_X], FactionInfo[factionid][Exterior_Y], FactionInfo[factionid][Exterior_Z]);
                    FactionInfo[factionid][FactionLabel] = CreateDynamic3DTextLabel(str, COLOR_WHITE, FactionInfo[factionid][Exterior_X], FactionInfo[factionid][Exterior_Y], FactionInfo[factionid][Exterior_Z]+0.4, 12);                         
                }
            }
        }
    }
    return true;
}
Reply
#2

can u explain more clearly what is the problem
Reply
#3

Once running the command (the exterior) is removed and re-created at the (staff members) position. After running this command then trying (/editfaction 1 Title [EG. MFTR]) it fails to execute. (Basically rendering that command use-less and the rest work. )
Reply
#4

Assistance is still needed/welcomed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)