27.07.2016, 21:09
Good idea phoenix that is really helpful. This is what I did btw.
Dialog 1:
Response to Dialog 1. This will check weather the player is in the range.
Dialog 2:
I made a forward for
and error from the line
Dialog 1:
PHP код:
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_HOUSE_NAME, DIALOG_STYLE_INPUT, "House Name", "Write a new name for this house:", "Change", "Back");
}
Dialog 2:
PHP код:
if(dialogid == DIALOG_HOUSE_NAME)
{
if ( !response ) return 1;
if ( response )
{
if(strlen(inputtext) > 2 && strlen(inputtext) < 21)
{
SetCameraBehindPlayer(playerid);
SetPlayerPos( playerid, housex-0.5 , housey, housez );
SetPlayerInterior( playerid, 0 );
TogglePlayerControllable(playerid,0);
SetTimerEx("WarningUnfreeze",4000,false,"id",playerid,GetPlayerVirtualWorld(playerid));
SetTimerEx("housename",3000,false,"id",playerid);
}
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");
}
}
}
Код HTML:
SetTimerEx("housename",3000,false,"id",playerid) <--- Dialog 2;
PHP код:
forward housename(playerid);
public housename(playerid)
{
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 );
return 1;
}
Quote:
(22602) : error 017: undefined symbol "inputtext" |