24.08.2016, 17:42
PHP код:
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 );
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 3 ], 1);
buyWatchTDControl( playerid, false );
return true;
}
if( playertextid == buyWatch[ playerid ][ 7 ] ) {
SendInfoMessage( playerid, "Odustali ste od kupovine sata." );
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 7 ], 1);
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 );
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 4 ], 1);
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 );
PlayerTextDrawSetSelectable(playerid,buyWatch[ playerid ][ 5 ], 1);
return true;
}