31.12.2016, 21:47
Hello there guys and Happy New Year !
I have a problem with command: /myhouses.
I doesn't have this command at my houses system, so
how i created the system i created /myhouses command also now.
So the problem is that. I don't know why when i select from /myhouses dialog
the house that i want to teleport, it's teleporting me to the next house from the dialog.
Command:
Dialogs:
OnPlayerConnect:
The Momentan_House_ID variable is setted like:
Can you help me to fix this command ?
If you know other mode how to make a command like this
to teleport to one of my houses from the dialog please tell here the solution.
More explicit:
1. When i select the First House ID: 173.
Then appear the dialog with: Teleport to House, but the Title says: [ID: 0] WHAT ?!

2. When i select Second House ID: 174.
Is teleporting me to the First House ID: 173 .. WTF?!
3. When i select Third House ID: 175
Is teleporting me to the Second House ID: 174.. :\
Dialog Picture:

I have a problem with command: /myhouses.
I doesn't have this command at my houses system, so
how i created the system i created /myhouses command also now.
So the problem is that. I don't know why when i select from /myhouses dialog
the house that i want to teleport, it's teleporting me to the next house from the dialog.
Command:
Код:
CMD:myhouses( playerid, params[ ] )
{
new query[ 200 ];
mysql_format( DB_Connect, query, sizeof( query ), "SELECT ID, HouseName, HousePassword FROM houses WHERE HouseOwner = '%s'", PlayerName( playerid ) );
mysql_query( DB_Connect, query );
eBigString[ 0 ] = EOS;
new rows = cache_num_rows( );
if( rows )
{
new id, hn[ MAX_HOUSE_NAME ], hp[ MAX_HOUSE_PASSWORD ];
format( eBigString, sizeof( eBigString ), "{FFFFFF}#\t{FFFFFF}House Name\t{FFFFFF}ID\t{FFFFFF}Password\n");
for( new i; i < rows; ++i )
{
id = cache_get_field_content_int( i, "ID" );
cache_get_field_content( i, "HouseName", hn );
cache_get_field_content( i, "HousePassword", hp );
PlayerInfo[ playerid ][ Momentan_House_ID ] = i;
format( eBigString, sizeof( eBigString ), "%s{FFFFFF}#\t%s\t%d\t%s\n", eBigString, hn, id, hp );
}
ShowPlayerDialog( playerid, DIALOG_HOUSES_TELEPORT, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}My Houses:", eBigString, "Select", "Exit" );
}
else
{
SendError( playerid, "You don't have any Houses" );
}
return 1;
}
Код:
ase DIALOG_HOUSES_TELEPORT:
{
if( response )
{
new message[ 7000 ];
new count = 0;
for( new i = 0; i < MAX_HOUSES; i++ )
{
if( !strcmp( HouseData[ i ][ Owner ], PlayerName( playerid ) ) )
{
if( count == listitem )
{
PlayerInfo[ playerid ][ Momentan_House_ID ] = i;
format( message, sizeof( message ), "{FFFFFF}%s (ID: {C0C0C0}%d {FFFFFF}):", HouseData[ i ][ Name ], i );
ShowPlayerDialog( playerid, DIALOG_HOUSES_TELEPORT_2, DIALOG_STYLE_LIST, message, "{FFFFFF}Teleport to House", "Select", "Back" );
break;
}
else
{
count ++;
}
}
}
}
}
case DIALOG_HOUSES_TELEPORT_2:
{
if( response )
{
new i = PlayerInfo[ playerid ][ Momentan_House_ID ];
switch( listitem )
{
case 0:
{
SetPVarInt( playerid, "HousePickupCooldown", gettime( ) + HOUSE_COOLDOWN );
SetPlayerPos( playerid, HouseData[ i ][ houseX ], HouseData[ i ][ houseY ], HouseData[ i ][ houseZ ] );
SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 0 );
FormatMSG( playerid, 0xC0C0C0FF, "[INFO]: {FFFFFF}You've been teleported to: {FFFFFF}'%s (ID: {C0C0C0}%d{FFFFFF})'.", HouseData[ i ][ Name ], i );
}
}
}
else
{
cmd_myhouses( playerid, "" );
}
}
The Momentan_House_ID variable is setted like:
Код:
PlayerInfo[ playerid ][ Momentan_House_ID ] = -1;
If you know other mode how to make a command like this
to teleport to one of my houses from the dialog please tell here the solution.
More explicit:
1. When i select the First House ID: 173.
Then appear the dialog with: Teleport to House, but the Title says: [ID: 0] WHAT ?!

2. When i select Second House ID: 174.
Is teleporting me to the First House ID: 173 .. WTF?!
3. When i select Third House ID: 175
Is teleporting me to the Second House ID: 174.. :\
Dialog Picture:


