Ondialogresponse - inputtext is random number - 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: Ondialogresponse - inputtext is random number (
/showthread.php?tid=576178)
Ondialogresponse - inputtext is random number -
SandKing94 - 01.06.2015
Code:
Код:
else if(dialogid == 18)
{
if(response)
{
new string[128], query[200];
format(query,sizeof(query),"UPDATE doors SET pickup = %d WHERE ID = %d",inputtext,EditingDoorid);
mysql_function_query(Connection,query,false,"","");
format(dInfo[EditingDoorid][dPickup], 4, inputtext);
DestroyPickup(dInfo[EditingDoorid][dOne]);
Delete3DTextLabel(dInfo[EditingDoorid][dTwo]);
dInfo[EditingDoorid][dOne] = CreatePickup(dInfo[EditingDoorid][dPickup], 1, dInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 0);
format(string, sizeof(string), "%s", dInfo[EditingDoorid][dText]);
dInfo[EditingDoorid][dTwo] = Create3DTextLabel(string, COLOR_WHITE, dInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 0, 0);
format(string, sizeof(string), "[Admin Log]: %s has changed the pickup of doorid %d.", PN(playerid), EditingDoorid);
SendAdminMessage(string);
Log("Logs/Admin.log", string);
}
else return 0;
It just sets dInfo[EditingDoorid][dPickup] as random number from 10-99 and i dont know why.
Re: Ondialogresponse - inputtext is random number -
Konstantinos - 01.06.2015
"inputtext" is string.
If "pickup" meant to be an integer, you could replace it with "strval(inputtext)".
Else replace with "pickup = '%e'"
Re: Ondialogresponse - inputtext is random number -
FrankLucretti - 01.06.2015
PHP код:
else if(dialogid == 18)
{
if(response)
{
new string[128], query[200];
format(query,sizeof(query),"UPDATE doors SET pickup = %d WHERE ID = %d",string,EditingDoorid);
mysql_function_query(Connection,query,false,"","");
format(dInfo[EditingDoorid][dPickup], 4, inputtext);
DestroyPickup(dInfo[EditingDoorid][dOne]);
Delete3DTextLabel(dInfo[EditingDoorid][dTwo]);
dInfo[EditingDoorid][dOne] = CreatePickup(dInfo[EditingDoorid][dPickup], 1, dInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 0);
format(string, sizeof(string), "%s", pickup = '%e'[EditingDoorid][dText]);
dInfo[EditingDoorid][dTwo] = Create3DTextLabel(string, COLOR_WHITE, dInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 0, 0);
format(string, sizeof(string), "[Admin Log]: %s has changed the pickup of doorid %d.", PN(playerid), EditingDoorid);
SendAdminMessage(string);
Log("Logs/Admin.log", string);
}
else return 0;
Please +1Rep and make me happy