Ondialogresponse - inputtext is random number
#1

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.
Reply
#2

"inputtext" is string.

If "pickup" meant to be an integer, you could replace it with "strval(inputtext)".
Else replace with "pickup = '%e'"
Reply
#3

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], 4inputtext);
            
DestroyPickup(dInfo[EditingDoorid][dOne]);
            
Delete3DTextLabel(dInfo[EditingDoorid][dTwo]);
            
dInfo[EditingDoorid][dOne] = CreatePickup(dInfo[EditingDoorid][dPickup], 1dInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 0);
            
format(stringsizeof(string), "%s"pickup '%e'[EditingDoorid][dText]);
            
dInfo[EditingDoorid][dTwo] = Create3DTextLabel(stringCOLOR_WHITEdInfo[EditingDoorid][dPos][0], dInfo[EditingDoorid][dPos][1], dInfo[EditingDoorid][dPos][2], 00);
               
format(stringsizeof(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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)