27.07.2016, 18:35
(
Последний раз редактировалось kampuman; 28.07.2016 в 07:38.
)
The script below works almost completely. But the problem after a Player set his house name, the house name saves but the House ID is not saving correctly. It shows -255 in the mysql_logs.
MYSQL_LOG
HOUSE NAME SCRIPT
MYSQL_LOG
Quote:
[22:30:28] CMySQLHandler::Query(resultID) - Threaded query with id 18 started. (Extra ID: 0) [22:30:28] CMySQLHandler::ProcessQueryThread(UPDATE `houses` SET `HName` = 'test' WHERE `HouseID` = '-255') - Data is getting passed to OnQueryFinish() - (Threadsafe: Yes) [22:30:28] OnQueryFinish(18,"UPDATE `houses` SET `HName` = 'test' WHERE `HouseID` = '-255'") - Called. |
PHP код:
if(strlen(inputtext) > 2 && strlen(inputtext) < 21)
{
new housenumber = GetHouseID( playerid );
if ( strcmp( GetGVarStringEx( "h_Owner", housenumber ), PlayerName( playerid ), false ) )
return SendClientMessage( playerid, -1,""SV_RD"» {c8c8c8}This house isn't yours!" );
format( gsQuery, sizeof gsQuery, "UPDATE `houses` SET `HName` = '%s' WHERE `HouseID` = '%d'", inputtext, housenumber );
mysql_query( gsQuery, THREAD_NONE, playerid );
SetGVarString( "h_name", "%s", housenumber );
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 );
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-20 Character.");
ShowPlayerDialog(playerid, DIALOG_HOUSE_NAME, DIALOG_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");
}