MySQL saving/updating problem
#7

Good idea phoenix that is really helpful. This is what I did btw.

Dialog 1:
PHP код:
            if(listitem == 0)
            {
                
ShowPlayerDialog(playeridDIALOG_HOUSE_NAMEDIALOG_STYLE_INPUT"House Name""Write a new name for this house:""Change""Back");
            } 
Response to Dialog 1. This will check weather the player is in the range.
Dialog 2:
PHP код:
    if(dialogid == DIALOG_HOUSE_NAME)
    {
        if ( !
response ) return 1;
        if ( 
response )
        {
            if(
strlen(inputtext) > && strlen(inputtext) < 21)
            {
                
SetCameraBehindPlayer(playerid);
                
SetPlayerPosplayeridhousex-0.5 houseyhousez );
                
SetPlayerInteriorplayerid);
                
TogglePlayerControllable(playerid,0);
                
SetTimerEx("WarningUnfreeze",4000,false,"id",playerid,GetPlayerVirtualWorld(playerid));
                
SetTimerEx("housename",3000,false,"id",playerid);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"Error: {ffffff}You must enter 2-20 Character.");
                
ShowPlayerDialog(playeridDIALOG_HOUSE_NAMEDIALOG_STYLE_INPUT"House Name""Write a new name for this house:\n\n{E74C3C}The name you entered is either too short or too long.""Change""Back");
            }
        }
    } 
I made a forward for

Код HTML:
SetTimerEx("housename",3000,false,"id",playerid) <--- Dialog 2;
PHP код:
forward housename(playerid);
public 
housename(playerid)
{
    new 
housenumber GetHouseIDplayerid );
    if ( 
strcmpGetGVarStringEx"h_Owner"housenumber ), PlayerNameplayerid ), false ) )
    return 
SendClientMessageplayerid, -1,""SV_RD"» {c8c8c8}This house isn't yours!" );
    
formatgsQuerysizeof gsQuery"UPDATE `houses` SET `HName` = '%s' WHERE `HouseID` = '%d'"inputtexthousenumber );
    
mysql_querygsQueryTHREAD_NONEplayerid );
    
SetGVarString"h_name""%s"housenumber );
    
formatgsStringsizeofgsString ), ""W"Press "ORANGE_"H "W"key to Enter the House\n"SV_BL"House Name: "W"%s\n"SV_BL"House Owner: "W"%s\n "SV_BL"House Value: "W"%d$\n "SV_BL"House Privacy: "RED_"Closed\n"SV_BL"House ID: "ORANGE_"%d",GetGVarStringEx"h_name"housenumber ), PlayerName(playerid), GetGVarInt"h_Cost"housenumber),housenumber);
    
UpdateDynamic3DTextLabelTextText3D:GetGVarInt"House3DText"housenumber ), 0xFF9900FFgsString );
    return 
1;

and error from the line
Quote:

(22602) : error 017: undefined symbol "inputtext"

Reply


Messages In This Thread
MySQL Settimer with string - by kampuman - 27.07.2016, 18:35
Re: MySQL saving/updating problem - by ThePhenix - 27.07.2016, 18:40
Re: MySQL saving/updating problem - by kampuman - 27.07.2016, 18:48
Re: MySQL saving/updating problem - by [MG]Dimi - 27.07.2016, 20:07
Re: MySQL saving/updating problem - by kampuman - 27.07.2016, 20:27
Re: MySQL saving/updating problem - by ThePhenix - 27.07.2016, 20:48
Re: MySQL saving/updating problem - by kampuman - 27.07.2016, 21:09
Re: MySQL saving/updating problem - by kampuman - 28.07.2016, 01:00
Re: MySQL saving/updating problem - by Dragony92 - 28.07.2016, 02:05
Re: MySQL saving/updating problem - by kampuman - 28.07.2016, 06:35

Forum Jump:


Users browsing this thread: 2 Guest(s)