SA-MP Forums Archive
sscanf warning: Format specifier does not match - 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: sscanf warning: Format specifier does not match (/showthread.php?tid=579036)



sscanf warning: Format specifier does not match - FloxX - 24.06.2015

Код:
CMD:carmour(playerid, params[])
{
       	new string[255],
		value,
		i = SpawnARM+1,
		Float:x,
		Float:y,
		Float:z;
 	    if(sscanf(params,"dd", value)) return SendClientMessage(playerid, -1,"/carmour [ID 1-100]");
		GetPlayerPos(playerid, x, y, z);
        format( string, sizeof( string ), "ARM/ID_%d.ini", i);
        if(dini_Exists(string)) {
			SpawnARM++;
         	format( string, sizeof( string ), "ARMOUR (ID: %d) sudah ada!", i);
           	SendClientMessage( playerid, -1, string);
   		}
        else {
			Nope[i][aX] = x;
			Nope[i][aY] = y;
			Nope[i][aZ] = z;
			Nope[i][AValue] = value;
			dini_Create(string);
			SaveArm(i);
            SpawnARM++;
            format(string,sizeof(string),"", i);
            Nope[i][lARM] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, Nope[i][aX], Nope[i][aY], Nope[i][aZ]+0.30,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
            Nope[i][APickup] = CreateDynamicPickup(1242, 1, Nope[i][aX], Nope[i][aY], Nope[i][aZ], 0);
   			format(string, sizeof( string ), "ID {FF0000}Armour{FFFFFF} Regen: %d.", i);
			SendClientMessage(playerid, -1, string);
	}
        return 1;
}

CMD:darmour(playerid, params[])
{
    new id, string[128], FileName[128];
    if(sscanf(params, "d", id)) return SendClientMessage( playerid, COLOR_WHITE, "GUNAKAN: /darmour [ID]" );
	format( string, sizeof( string ), "ARM/ID_%d.ini", id);
    if(!fexist(string)) {
    	SendClientMessage( playerid, -1, "Armour ID salah!" );
     	return 1;
    }
 	else {
 		DestroyDynamic3DTextLabel(Nope[id][lARM]);
 		DestroyDynamicPickup(Nope[id][APickup]);
		format(string, sizeof(string), "Anda telah menghapus armour(ID: %d).", id);
	    SendClientMessage( playerid, COLOR_WHITE, string);
	    format(FileName, sizeof(FileName), "ARM/ID_%d.ini", id);
	    dini_Remove(FileName);
	    SpawnARM--;
	}
    return 1;
}
What could be causing this?
Note: Command works perfectly.

It shows that warning if i type /carmour [id] or /darmour [id]
please help


Re: sscanf warning: Format specifier does not match - AndySedeyn - 24.06.2015

PHP код:
if(sscanf(params,"dd"value)) 
You are using two decimal specifiers, yet only using one. Remove the extra 'd' between the double quotation.

Result:
PHP код:
if(sscanf(params,"d"value)) 



Re: sscanf warning: Format specifier does not match - FloxX - 24.06.2015

Thanks AndySedeyn .. , nice bro ..