input string to a dialog
#1

I need help. I'm trying to make my own Rename House script because the fs that I have downloaded doesn't have. So I'm not sure what exactly to do and how to make it right.

Edit: The dialogs is now showing but after after entering the value it didn't change the value. What could be the problem?
PHP код:
new housenumber GetHouseIDplayerid );
new 
MAX_HOUSE_NAME [20];
if ( 
strcmpGetGVarStringEx"h_Owner"housenumber ), PlayerNameplayerid ), false ) )
return 
SendClientMessageplayerid, -1,""SV_RD"» {c8c8c8}This house isn't yours!" );
if ( 
strlenMAX_HOUSE_NAME ) < || strlenMAX_HOUSE_NAME ) > 20 ) return ShowPlayerDialog(playeridDIALOG_HOUSE_NAMEDIALOG_STYLE_INPUT"Rename House""Write a new name for this house:\n\n{E74C3C}The name you entered is either too short or too long.""Change""Back");
formatgsQuerysizeof gsQuery"UPDATE `houses` SET `HName` = '%s' WHERE `HouseID` = '%d'"MAX_HOUSE_NAME,housenumber );
mysql_querygsQueryTHREAD_NONEplayerid );
 
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 ); 
Reply
#2

try to filter that code and make them a recovery and arranges to understand something else does not readable
Reply
#3

Код:
new housenumber = GetHouseID( playerid ); 
new MAX_HOUSE_NAME [20] = strlen(inputtext) ; 
if ( strcmp( GetGVarStringEx( "h_Owner", housenumber ), PlayerName( playerid ), false ) ) 
return SendClientMessage( playerid, -1,""SV_RD"» {c8c8c8}This house isn't yours!" ); 
if ( strlen( MAX_HOUSE_NAME ) < 1 || strlen( MAX_HOUSE_NAME ) > 20 ) return ShowPlayerDialog(playerid, DIALOG_HOUSE_NAME, DIALOG_STYLE_INPUT, "Rename House", "Write a new name for this house:\n\n{E74C3C}The name you entered is either too short or too long.", "Change", "Back"); 
format( gsQuery, sizeof gsQuery, "UPDATE `houses` SET `HName` = '%s' WHERE `HouseID` = '%d'", MAX_HOUSE_NAME,housenumber ); 
mysql_query( gsQuery, THREAD_NONE, playerid ); 
 format( gsString, sizeof( gsString ), ""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); 
UpdateDynamic3DTextLabelText( Text3D:GetGVarInt( "House3DText", housenumber ), 0xFF9900FF, gsString );
Test and tell if it works or not
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)