Help in speed boast + sscanf help + float help
#1

Hello i am Making Speed boast script with float speed
this is my code

new amount;
if ( sscanf( params, "g", amount ) ) return SendClientMessage( playerid, COLOR_ULTRARED, "{15D4ED}INFO {FFE4C4}You can also use /sb <1.0 - 1.4> to set your custom speedBoost." );
SendClientMessage( playerid, 0x33AA33AA,"{FF0000}xSF {7A7A7A}»{DBED15} {BABABA}You have {3BBD44}enabled {BABABA}speedboosting." );
SendClientMessage( playerid, 0x33AA33AA,"{15D4ED}INFO: {FFE4C4}Press the FIRE KEY while in a vehicle to activate it" );
Speedvalue[playerid] = amount;
format(gsQuery,sizeof(gsQuery),"UPDATE `accounts` SET `Speedvalue` = '%0.2f' WHERE `Key` = '%d'",Speedvalue[playerid],PlayerInfo[ playerid ][ AccID ]);
mysql_query( gsQuery, THREAD_NONE, playerid );


but its not working when i type command game crashes and texture gets bugged .i think the bug is in sscanf

i will +rep if you will help me
Reply
#2

Well, amount should be a float.
pawn Код:
new Float: amount;

//Speedvalue[playerid] should also be defined as a Float
And I'm not sure which version of MySQL you're using, but I'm pretty sure 'format' should be 'mysql_format':
pawn Код:
mysql_format(handleid, gsQuery, sizeof gsQuery, "UPDATE `accounts` SET `Speedvalue` = %f WHERE `Key` = %d",Speedvalue[playerid],PlayerInfo[ playerid ][ AccID ]);

mysql_query(handleid, gsQuery);
Reply
#3

thats not the error i have already dont thaat
Reply
#4

show up when key pressed , and use [PAWN] [ /PAWN] remove space between the / and [
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)