Tektdrav bites me when I want to go further and put himself back under OnPlayerClickPlayerTextdraw or does not respond to me click on it
PHP код:
public OnPlayerClickPlayerTextDraw( playerid, PlayerText:playertextid ) {
if( _:playertextid != INVALID_TEXT_DRAW ) {
if( playertextid == KladionicaSM[ playerid ][ 31 ] ) {
new str[ 128 ];
strdel( DialogStrgEx, 0, sizeof( DialogStrgEx ) );
strcat( DialogStrgEx, str );
for( new i = 0; i < 10; i++ )
{
format( str, sizeof( str ), "%s vs %s\n", bettingInfo[ Parovi[ i ][ parID ][ 0 ] ][ teamName ], bettingInfo[ Parovi[ i ][ parID ][ 1 ] ][ teamName ] );
strcat( DialogStrgEx, str );
}
SPD( playerid, dialog_UPLATITIKET, DSL, "Izaberi par:", DialogStrgEx, "Izaberi", "Odustani" );
strdel( DialogStrgEx, 0, sizeof( DialogStrgEx ));
return true;
}
//Kupi sat
if( playertextid == buyWatch[ playerid ][ 3 ] ) {
new text[ 30 ];
if( WatchModel[ playerid ] == 19039 ) {
if( GetPlayerMoney(playerid) < 4980 ) return SendErrorMessage( playerid, "Nemate dovoljno novca." );
GivePlayerMoney( playerid, -4980 );
text = "Rolex Datejust za 4980 rsd";
PlayerInfo[ playerid ][ pWatch ] = 19039;
}
else if( WatchModel[ playerid ] == 19040 ) {
if( GetPlayerMoney(playerid) < 6180 ) return SendErrorMessage( playerid, "Nemate dovoljno novca." );
GivePlayerMoney( playerid, -6180 );
text = "Emporio Armani za 6180 rsd";
PlayerInfo[ playerid ][ pWatch ] = 19040;
}
else if( WatchModel[ playerid ] == 19041 ) {
if( GetPlayerMoney(playerid) < 7230 ) return SendErrorMessage( playerid, "Nemate dovoljno novca." );
GivePlayerMoney( playerid, -7230 );
text = "Casio G-Shock za 7230 rsd";
PlayerInfo[ playerid ][ pWatch ] = 19041;
}
else if( WatchModel[ playerid ] == 19042 ) {
if( GetPlayerMoney(playerid) < 8190 ) return SendErrorMessage( playerid, "Nemate dovoljno novca." );
GivePlayerMoney( playerid, -8190 );
text = "Michael Kors za 8190 rsd";
PlayerInfo[ playerid ][ pWatch ] = 19042;
}
else if( WatchModel[ playerid ] == 19043 ) {
if( GetPlayerMoney(playerid) < 9160 ) return SendErrorMessage( playerid, "Nemate dovoljno novca." );
GivePlayerMoney( playerid, -9160 );
text = "Hugo Boss za 9160 rsd";
PlayerInfo[ playerid ][ pWatch ] = 19043;
}
SendInfoMessage( playerid, "Uspesno si kupio sat marke %s.( koristi komandu /time ).", text );
buyWatchTDControl( playerid, false );
return true;
}
if( playertextid == buyWatch[ playerid ][ 7 ] ) {
SendInfoMessage( playerid, "Odustali ste od kupovine sata." );
buyWatchTDControl( playerid, false );
return true;
}
if( playertextid == buyWatch[ playerid ][ 4 ] ) {
new text[ 30 ];
if( WatchModel[ playerid ] == 19043 ) return 1;
WatchModel[ playerid ]++;
PlayerTextDrawSetPreviewModel( playerid, buyWatch[ playerid ][ 1 ], WatchModel[ playerid ] );
PlayerTextDrawShow( playerid, buyWatch[ playerid ][ 1 ] );
if( WatchModel[ playerid ] == 19039 ) text = "Rolex Datejust - 4980 rsd";
else if( WatchModel[ playerid ] == 19040 ) text = "Emporio Armani - 6180 rsd";
else if( WatchModel[ playerid ] == 19041 ) text = "Casio G-Shock - 7230 rsd";
else if( WatchModel[ playerid ] == 19042 ) text = "Michael Kors - 8190 rsd";
else if( WatchModel[ playerid ] == 19043 ) text = "Hugo Boss - 9160 rsd";
PlayerTextDrawSetString( playerid, buyWatch[ playerid ][ 2 ], text );
return true;
}
if( playertextid == buyWatch[ playerid ][ 5 ] ) {
new text[ 30 ];
if( WatchModel[ playerid ] == 19039 ) return 1;
WatchModel[ playerid ]--;
PlayerTextDrawSetPreviewModel( playerid, buyWatch[ playerid ][ 1 ], WatchModel[ playerid ] );
PlayerTextDrawShow( playerid, buyWatch[ playerid ][ 1 ] );
if( WatchModel[ playerid ] == 19039 ) text = "Rolex Datejust - 4980 rsd";
else if( WatchModel[ playerid ] == 19040 ) text = "Emporio Armani - 6180 rsd";
else if( WatchModel[ playerid ] == 19041 ) text = "Casio G-Shock - 7230 rsd";
else if( WatchModel[ playerid ] == 19042 ) text = "Michael Kors - 8190 rsd";
else if( WatchModel[ playerid ] == 19043 ) text = "Hugo Boss - 9160 rsd";
PlayerTextDrawSetString( playerid, buyWatch[ playerid ][ 2 ], text );
return true;
}
}
return 1;
}
PHP код:
stock buyWatchTDControl( playerid, bool:show ) {
if( show == true ) {
buyWatch[ playerid ][ 0 ] = CreatePlayerTextDraw(playerid,410.000000, 170.000000, " ");
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 0 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 0 ], 1);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 0 ], 0.500000, 12.399997);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 0 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 0 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 0 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 0 ], 1);
PlayerTextDrawUseBox(playerid,buyWatch[ playerid ][ 0 ], 1);
PlayerTextDrawBoxColor(playerid,buyWatch[ playerid ][ 0 ], 100);
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 0 ], 230.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 0 ], 0);
buyWatch[ playerid ][ 1 ] = CreatePlayerTextDraw(playerid,230.000000, 165.000000, " ");
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 1 ], 0 );
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 1 ], 5);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 1 ], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 1 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 1 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 1 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 1 ], 1);
PlayerTextDrawUseBox(playerid,buyWatch[ playerid ][ 1 ], 1);
PlayerTextDrawBoxColor(playerid,buyWatch[ playerid ][ 1 ], 255);
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 1 ], 180.000000, 100.000000);
PlayerTextDrawSetPreviewModel(playerid, buyWatch[ playerid ][ 1 ], 19039);
PlayerTextDrawSetPreviewRot(playerid, buyWatch[ playerid ][ 1 ], 0.000000, 90.000000, 10.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 1 ], 0);
buyWatch[ playerid ][ 2 ] = CreatePlayerTextDraw(playerid,319.000000, 256.000000, "Rolex Datejust - 4980 rsd");
PlayerTextDrawAlignment(playerid,buyWatch[ playerid ][ 2 ], 2);
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 2 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 2 ], 2);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 2 ], 0.300000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 2 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 2 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 2 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 2 ], 1);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 2 ], 0);
buyWatch[ playerid ][ 3 ] = CreatePlayerTextDraw(playerid,319.000000, 269.000000, "kupi_sat");
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 3 ], 40.000000, 20.000000);
PlayerTextDrawAlignment(playerid,buyWatch[ playerid ][ 3 ], 2);
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 3 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 3 ], 2);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 3 ], 0.300000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 3 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 3 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 3 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 3 ], 1);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 3 ], 1);
buyWatch[ playerid ][ 4 ] = CreatePlayerTextDraw(playerid,382.000000, 270.000000, "ld_beat:right");
PlayerTextDrawAlignment(playerid,buyWatch[ playerid ][ 4 ], 2);
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 4 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 4 ], 4);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 4 ], 0.300000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 4 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 4 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 4 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 4 ], 1);
PlayerTextDrawUseBox(playerid,buyWatch[ playerid ][ 4 ], 1);
PlayerTextDrawBoxColor(playerid,buyWatch[ playerid ][ 4 ], 255);
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 4 ], 20.000000, 10.000000);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 4 ], 1);
buyWatch[ playerid ][ 5 ] = CreatePlayerTextDraw(playerid,236.000000, 270.000000, "ld_beat:left");
PlayerTextDrawAlignment(playerid,buyWatch[ playerid ][ 5 ], 2);
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 5 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 5 ], 4);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 5 ], 0.300000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 5 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 5 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 5 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 5 ], 1);
PlayerTextDrawUseBox(playerid,buyWatch[ playerid ][ 5 ], 1);
PlayerTextDrawBoxColor(playerid,buyWatch[ playerid ][ 5 ], 255);
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 5 ], 20.000000, 10.000000);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 5 ], 1);
buyWatch[ playerid ][ 6 ] = CreatePlayerTextDraw(playerid,316.000000, 264.000000, "-");
PlayerTextDrawAlignment(playerid,buyWatch[ playerid ][ 6 ], 2);
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 6 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 6 ], 2);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 6 ], 13.700016, 0.499999);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 6 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 6 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 6 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 6 ], 1);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 6 ], 0);
buyWatch[ playerid ][ 7 ] = CreatePlayerTextDraw(playerid,384.000000, 169.000000, "ld_beat:cross");
PlayerTextDrawBackgroundColor(playerid,buyWatch[ playerid ][ 7 ], 255);
PlayerTextDrawFont(playerid,buyWatch[ playerid ][ 7 ], 4);
PlayerTextDrawLetterSize(playerid,buyWatch[ playerid ][ 7 ], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,buyWatch[ playerid ][ 7 ], -1);
PlayerTextDrawSetOutline(playerid,buyWatch[ playerid ][ 7 ], 0);
PlayerTextDrawSetProportional(playerid,buyWatch[ playerid ][ 7 ], 1);
PlayerTextDrawSetShadow(playerid,buyWatch[ playerid ][ 7 ], 1);
PlayerTextDrawUseBox(playerid,buyWatch[ playerid ][ 7 ], 1);
PlayerTextDrawBoxColor(playerid,buyWatch[ playerid ][ 7 ], 255);
PlayerTextDrawTextSize(playerid,buyWatch[ playerid ][ 7 ], 21.000000, 11.000000);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 7 ], 0);
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 7 ], 1);
for( new i = 0; i < 8; i++ ) {
PlayerTextDrawShow( playerid, buyWatch[ playerid ][ i ] );
}
SelectTextDraw( playerid, SANMARINO );
}
else if( show == false ) {
for( new i = 0; i < 8; i ++) {
PlayerTextDrawHide( playerid, buyWatch[ playerid ][ i ] );
PlayerTextDrawDestroy( playerid, buyWatch[ playerid ][ i ] );
buyWatch[ playerid ][ i ] = PlayerText:INVALID_TEXT_DRAW;
}
CancelSelectTextDraw( playerid );
}
}