Merged in changes (pull request #27)

Changes
This commit is contained in:
Steven Howard 2018-10-08 21:52:26 +00:00 committed by Lorenc Pekaj
commit 0065363f9d
5 changed files with 381 additions and 128 deletions

View File

@ -126,55 +126,56 @@
#define DIALOG_COMPONENT_EDIT 1115
#define DIALOG_COMPONENT_EDIT_MENU 1116
#define DIALOG_COMPONENT_MENU 1117
#define DIALOG_DONATED_DIAGOLD 1118
#define DIALOG_LATEST_DONOR 1119
#define DIALOG_FINISHED_DONATING 1120
#define DIALOG_MODIFY_HITSOUND 1121
#define DIALOG_VIP_NOTE 1122
#define DIALOG_REGISTER_QUIT 1123
#define DIALOG_LOGIN_QUIT 1124
#define DIALOG_WEAPON_LOCKER 1125
#define DIALOG_WEAPON_LOCKER_BUY 1126
#define DIALOG_FEEDBACK 1127
#define DIALOG_IC_MARKET_2 1128
#define DIALOG_BUSINESS_CAR 1129
#define DIALOG_BUSINESS_HELI 1130
#define DIALOG_ACC_GUARD 1131
#define DIALOG_ACC_GUARD_EMAIL 1132
#define DIALOG_ACC_GUARD_MODE 1133
#define DIALOG_ACC_GUARD_CONFIRM 1134
#define DIALOG_ACC_GUARD_DEL_CANCEL 1135
#define DIALOG_RACE 1136
#define DIALOG_RACE_MODE 1137
#define DIALOG_RACE_FEE 1138
#define DIALOG_RACE_POS 1139
#define DIALOG_RACE_DISTANCE 1140
#define DIALOG_RACE_KICK 1141
#define DIALOG_RACE_DEST 1142
#define DIALOG_RACE_PRESELECT 1143
#define DIALOG_RACE_CUSTOM_DEST 1144
#define DIALOG_BUSINESS_SELL 1145
#define DIALOG_BUSINESS_NAME 1146
#define DIALOG_BUSINESS_ADD_MEMBER 1147
#define DIALOG_BUSINESS_MEMBERS 1148
#define DIALOG_BUSINESS_WITHDRAW 1149
#define DIALOG_BUSINESS_UPGRADES 1150
#define DIALOG_BUSINESSES 1151
#define DIALOG_CASINO_REWARDS 1152
#define DIALOG_AIRPORT 1153
#define DIALOG_CASINO_BAR 1154
#define DIALOG_ACC_EMAIL 1155
#define DIALOG_BUSINESS_SECURITY 1156
#define DIALOG_FACILITY_SPAWN 1157
#define DIALOG_IC_MARKET_3 1158
#define DIALOG_BUY_VIP 1159
#define DIALOG_TOYS_COLOR 1160
#define DIALOG_HIGHSCORES 1161
#define DIALOG_HIGHSCORES_BACK 1162
#define DIALOG_CROWDFUNDS 1163
#define DIALOG_CROWDFUND_OPTIONS 1164
#define DIALOG_CROWDFUND_INFO 1165
#define DIALOG_CROWDFUND_DONATE 1166
#define DIALOG_COMPONENTS_RESPONSE 1118
#define DIALOG_DONATED_DIAGOLD 1119
#define DIALOG_LATEST_DONOR 1120
#define DIALOG_FINISHED_DONATING 1121
#define DIALOG_MODIFY_HITSOUND 1123
#define DIALOG_VIP_NOTE 1124
#define DIALOG_REGISTER_QUIT 1125
#define DIALOG_LOGIN_QUIT 1126
#define DIALOG_WEAPON_LOCKER 1127
#define DIALOG_WEAPON_LOCKER_BUY 1128
#define DIALOG_FEEDBACK 1129
#define DIALOG_IC_MARKET_2 1130
#define DIALOG_BUSINESS_CAR 1131
#define DIALOG_BUSINESS_HELI 1132
#define DIALOG_ACC_GUARD 1133
#define DIALOG_ACC_GUARD_EMAIL 1134
#define DIALOG_ACC_GUARD_MODE 1135
#define DIALOG_ACC_GUARD_CONFIRM 1136
#define DIALOG_ACC_GUARD_DEL_CANCEL 1137
#define DIALOG_RACE 1138
#define DIALOG_RACE_MODE 1139
#define DIALOG_RACE_FEE 1140
#define DIALOG_RACE_POS 1141
#define DIALOG_RACE_DISTANCE 1142
#define DIALOG_RACE_KICK 1143
#define DIALOG_RACE_DEST 1144
#define DIALOG_RACE_PRESELECT 1145
#define DIALOG_RACE_CUSTOM_DEST 1146
#define DIALOG_BUSINESS_SELL 1147
#define DIALOG_BUSINESS_NAME 1148
#define DIALOG_BUSINESS_ADD_MEMBER 1149
#define DIALOG_BUSINESS_MEMBERS 1150
#define DIALOG_BUSINESS_WITHDRAW 1151
#define DIALOG_BUSINESS_UPGRADES 1152
#define DIALOG_BUSINESSES 1153
#define DIALOG_CASINO_REWARDS 1154
#define DIALOG_AIRPORT 1155
#define DIALOG_CASINO_BAR 1156
#define DIALOG_ACC_EMAIL 1157
#define DIALOG_BUSINESS_SECURITY 1158
#define DIALOG_FACILITY_SPAWN 1159
#define DIALOG_IC_MARKET_3 1160
#define DIALOG_BUY_VIP 1161
#define DIALOG_TOYS_COLOR 1162
#define DIALOG_HIGHSCORES 1163
#define DIALOG_HIGHSCORES_BACK 1164
#define DIALOG_CROWDFUNDS 1165
#define DIALOG_CROWDFUND_OPTIONS 1166
#define DIALOG_CROWDFUND_INFO 1167
#define DIALOG_CROWDFUND_DONATE 1168
/* ** Hooks ** */
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )

View File

@ -89,6 +89,7 @@ hook OnPlayerFirstSpawn( playerid )
PreloadAnimationLibrary( playerid, "INT_HOUSE" );
PreloadAnimationLibrary( playerid, "MISC" );
PreloadAnimationLibrary( playerid, "POOL" );
PreloadAnimationLibrary( playerid, "SMOKING" );
return 1;
}
@ -275,6 +276,12 @@ CMD:handsup( playerid, params[ ] )
return 1;
}
CMD:smoke( playerid, params[ ] )
{
CreateLoopingAnimation( playerid, "SMOKING", "M_smk_in", 4.0, 1, 0, 0, 0, 0 );
return 1;
}
CMD:cower( playerid, params[ ] )
{
CreateLoopingAnimation( playerid, "PED", "COWER", 4.0, 1, 0, 0, 0, 0 );

View File

@ -24,7 +24,7 @@ enum E_PAINTBALL_DATA
E_LIMIT, E_WEAPONS[ 3 ], E_PLAYERS,
E_ARENA, Float: E_ARMOUR, Float: E_HEALTH,
bool: E_ACTIVE, bool: E_PASSWORDED, bool: E_REFILLER,
E_CD_TIMER, bool: E_HEADSHOT
E_CD_TIMER, bool: E_HEADSHOT, bool: E_CHAT
};
enum E_PAINTBALL_ARENAS
@ -178,6 +178,13 @@ hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
SendClientMessageToPaintball( iLobby, -1, ""COL_GREY"[PAINTBALL]"COL_WHITE" Headshot mode has been %s.", g_paintballData[ iLobby ] [ E_HEADSHOT ] == false ? ( "un-toggled" ) : ( "toggled" ) );
showPaintBallLobbyData( playerid, iLobby );
}
case 11:
{
new iLobby = p_PaintBallArena{ playerid };
g_paintballData[ iLobby ] [ E_CHAT ] = !g_paintballData[ iLobby ] [ E_CHAT ];
SendClientMessageToPaintball( iLobby, -1, ""COL_GREY"[PAINTBALL]"COL_WHITE" Upon death, armour and/or health will%s be restored.", g_paintballData[ iLobby ] [ E_CHAT ] == false ? ( " not" ) : ( "" ) );
showPaintBallLobbyData( playerid, iLobby );
}
}
}
else
@ -417,12 +424,21 @@ stock listPaintBallLobbies( playerid )
stock showPaintBallLobbyData( playerid, id, second_button[ ] = "Join Game" )
{
format( szLargeString, sizeof( szLargeString ), "Lobby Name\t\t"COL_GREY"%s"COL_WHITE"\nLobby Password\t%s"COL_WHITE"\nPlayer Capacity\t\t"COL_GREY"%d"COL_WHITE"\nHealth\t\t\t"COL_GREY"%0.2f%%"COL_WHITE"\nArmour\t\t\t"COL_GREY"%0.2f%%"COL_WHITE"\nRefill Health/Armour\t%s"COL_WHITE"\nArena\t\t\t"COL_GREY"%s"COL_WHITE"\nPrimary Weapon\t"COL_GREY"%s"COL_WHITE"\nSecondary Weapon\t"COL_GREY"%s"COL_WHITE"\nTertiary Weapon\t"COL_GREY"%s"COL_WHITE"\nHeadshot Mode\t"COL_GREY"%s",
g_paintballData[ id ] [ E_NAME ], g_paintballData[ id ] [ E_PASSWORDED ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ), g_paintballData[ id ] [ E_LIMIT ], g_paintballData[ id ] [ E_HEALTH ], g_paintballData[ id ] [ E_ARMOUR ], g_paintballData[ id ] [ E_REFILLER ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ), g_paintballArenaData[ g_paintballData[ id ] [ E_ARENA ] ] [ E_NAME ],
ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 0 ] ), ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 1 ] ), ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 2 ] ),
g_paintballData[ id ] [ E_HEADSHOT ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" )
format( szLargeString, sizeof( szLargeString ), "Lobby Name\t"COL_GREY"%s"COL_WHITE"\nLobby Password\t%s"COL_WHITE"\nPlayer Capacity\t"COL_GREY"%d"COL_WHITE"\nHealth\t"COL_GREY"%0.2f%%"COL_WHITE"\nArmour\t"COL_GREY"%0.2f%%"COL_WHITE"\nRefill Health/Armour\t%s"COL_WHITE"\nArena\t"COL_GREY"%s"COL_WHITE"\nPrimary Weapon\t"COL_GREY"%s"COL_WHITE"\nSecondary Weapon\t"COL_GREY"%s"COL_WHITE"\nTertiary Weapon\t"COL_GREY"%s"COL_WHITE"\nHeadshot Mode\t"COL_GREY"%s"COL_WHITE"\nChat\t"COL_GREY"%s",
g_paintballData[ id ] [ E_NAME ],
g_paintballData[ id ] [ E_PASSWORDED ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ),
g_paintballData[ id ] [ E_LIMIT ],
g_paintballData[ id ] [ E_HEALTH ],
g_paintballData[ id ] [ E_ARMOUR ],
g_paintballData[ id ] [ E_REFILLER ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ),
g_paintballArenaData[ g_paintballData[ id ] [ E_ARENA ] ] [ E_NAME ],
ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 0 ] ),
ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 1 ] ),
ReturnWeaponName( g_paintballData[ id ] [ E_WEAPONS ] [ 2 ] ),
g_paintballData[ id ] [ E_HEADSHOT ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" ),
g_paintballData[ id ] [ E_CHAT ] == true ? ( ""COL_GREEN"ENABLED" ) : ( ""COL_RED"DISABLED" )
);
ShowPlayerDialog( playerid, DIALOG_PAINTBALL_EDIT, DIALOG_STYLE_LIST, "{FFFFFF}Paintball - Lobby Settings", szLargeString, "Change", second_button );
ShowPlayerDialog( playerid, DIALOG_PAINTBALL_EDIT, DIALOG_STYLE_TABLIST, "{FFFFFF}Paintball - Lobby Settings", szLargeString, "Change", second_button );
}
stock ShowPlayerPaintballArenas( playerid )
@ -644,6 +660,7 @@ CMD:p( playerid, params[ ] )
if ( sscanf( params, "s[90]", msg ) ) return SendUsage( playerid, "/p [MESSAGE]" );
else if ( textContainsIP( msg ) ) return SendServerMessage( playerid, "Please do not advertise." );
else if ( !g_paintballData[ id ] [ E_CHAT ] ) return SendError( playerid, "Paintball chat is disabled in this lobby." );
else
{
SendClientMessageToPaintball( id, -1, ""COL_GREY"<Paintball Chat> %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, msg );

View File

@ -328,83 +328,217 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
return ShowPlayerVehicleComponents( playerid, listitem );
}
else if ( dialogid == DIALOG_COMPONENTS )
{
SetPVarInt( playerid, "components_item", listitem );
if ( response )
{
ShowPlayerDialog(playerid, DIALOG_COMPONENTS_RESPONSE, DIALOG_STYLE_LIST, ""COL_WHITE"Pimp My Ride", "Purchase Component\nPreview Component", "Select", "Back" );
}
else
{
return cmd_garage( playerid, "vehicle pimp" );
}
}
else if ( dialogid == DIALOG_COMPONENTS_RESPONSE )
{
new
iItem = GetPVarInt( playerid, "components_item" ),
iComponent = GetPVarInt( playerid, "components_category" );
if ( response )
{
for( new i = 0, x = 0; i < sizeof( g_vehicleComponentsData ); i++ ) if ( g_vehicleComponentsData[ i ] [ E_CATEGORY ] == iComponent )
switch( listitem )
{
if ( listitem == x++ )
case 0:
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendError( playerid, "You need to be in a vehicle to use this command." );
if ( GetPlayerCash( playerid ) < g_vehicleComponentsData[ i ] [ E_PRICE ] )
return SendError( playerid, "You need %s to purchase this vehicle component.", cash_format( g_vehicleComponentsData[ i ] [ E_PRICE ] ) );
if ( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER )
return SendError( playerid, "You need to be a driver to use this command." );
new
ownerid = INVALID_PLAYER_ID,
vehicleid = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid )
;
if ( vehicleid == -1 )
return SendError( playerid, "This vehicle isn't a buyable vehicle." );
if ( playerid != ownerid )
return SendError( playerid, "This vehicle does not belong to you." );
if ( GetVehicleCustomComponents( ownerid, vehicleid ) >= GetPlayerPimpVehicleSlots( ownerid ) )
return SendError( playerid, "You cannot purchase more than %d vehicle components.", GetPlayerPimpVehicleSlots( ownerid ) );
new
slotid = GetVehicleComponentSlot( ownerid, vehicleid );
if ( slotid == -1 )
return SendError( playerid, "You cannot add more than %d components to your vehicle.", MAX_PIMPS );
// make sure the person is above the limit
if ( g_vehicleComponentsData[ i ] [ E_LIMIT ] != 0 )
for( new i = 0, x = 0; i < sizeof( g_vehicleComponentsData ); i++ ) if ( g_vehicleComponentsData[ i ] [ E_CATEGORY ] == iComponent )
{
new
instances = 0;
if ( iItem == x++ )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendError( playerid, "You need to be in a vehicle to use this command." );
for( new p = 0; p < MAX_PIMPS; p++ )
if ( g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_CREATED ] [ p ] && g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_MODEL ] [ p ] == g_vehicleComponentsData[ i ] [ E_MODEL_ID ] )
instances ++;
if ( GetPlayerCash( playerid ) < g_vehicleComponentsData[ i ] [ E_PRICE ] )
return SendError( playerid, "You need %s to purchase this vehicle component.", cash_format( g_vehicleComponentsData[ i ] [ E_PRICE ] ) );
if ( instances >= g_vehicleComponentsData[ i ] [ E_LIMIT ] )
return SendError( playerid, "You can place a %s a maximum of %d time(s).", g_vehicleComponentsData[ i ] [ E_NAME ], g_vehicleComponentsData[ i ] [ E_LIMIT ] );
if ( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER )
return SendError( playerid, "You need to be a driver to use this command." );
new
ownerid = INVALID_PLAYER_ID,
vehicleid = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid )
;
if ( vehicleid == -1 )
return SendError( playerid, "This vehicle isn't a buyable vehicle." );
if ( playerid != ownerid )
return SendError( playerid, "This vehicle does not belong to you." );
if ( GetVehicleCustomComponents( ownerid, vehicleid ) >= GetPlayerPimpVehicleSlots( ownerid ) )
return SendError( playerid, "You cannot purchase more than %d vehicle components.", GetPlayerPimpVehicleSlots( ownerid ) );
new
slotid = GetVehicleComponentSlot( ownerid, vehicleid );
if ( slotid == -1 )
return SendError( playerid, "You cannot add more than %d components to your vehicle.", MAX_PIMPS );
// make sure the person is above the limit
if ( g_vehicleComponentsData[ i ] [ E_LIMIT ] != 0 )
{
new
instances = 0;
for( new p = 0; p < MAX_PIMPS; p++ )
if ( g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_CREATED ] [ p ] && g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_MODEL ] [ p ] == g_vehicleComponentsData[ i ] [ E_MODEL_ID ] )
instances ++;
if ( instances >= g_vehicleComponentsData[ i ] [ E_LIMIT ] )
return SendError( playerid, "You can place a %s a maximum of %d time(s).", g_vehicleComponentsData[ i ] [ E_NAME ], g_vehicleComponentsData[ i ] [ E_LIMIT ] );
}
new
Float: X, Float: Y, Float: Z;
GivePlayerCash( playerid, -g_vehicleComponentsData[ i ] [ E_PRICE ] );
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_CREATED ] [ slotid ] = true;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_DISABLED ] [ slotid ] = false;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ slotid ] = g_vehicleComponentsData[ i ] [ E_MODEL_ID ];
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_X ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Y ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Z ] [ slotid ] = 1.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RX ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RY ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RZ ] [ slotid ] = 0.0;
format( szNormalString, sizeof( szNormalString ), "INSERT INTO `COMPONENTS` (`VEHICLE_ID`,`MODEL`,`X`,`Y`,`Z`,`RX`,`RY`,`RZ`) VALUES (%d,%d,0.0,0.0,1.0,0.0,0.0,0.0)", g_vehicleData[ ownerid ] [ vehicleid ] [ E_SQL_ID ], g_vehicleComponentsData[ i ] [ E_MODEL_ID ] );
mysql_function_query( dbHandle, szNormalString, true, "OnPlayerCreateVehicleComponent", "ddd", playerid, vehicleid, slotid );
GetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z );
SetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z + 0.05 );
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ slotid ] = CreateDynamicObject( g_vehicleComponentsData[ i ] [ E_MODEL_ID ], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .worldid = GetVehicleVirtualWorld( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ]) );
AttachDynamicObjectToVehicle( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ slotid ], g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 );
return SendServerMessage( playerid, "You have bought a "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_vehicleComponentsData[ i ] [ E_NAME ], cash_format( g_vehicleComponentsData[ i ] [ E_PRICE ] ) );
}
}
}
case 1:
{
new model = -1;
for( new i = 0, x = 0; i < sizeof( g_vehicleComponentsData ); i++ ) if ( g_vehicleComponentsData[ i ] [ E_CATEGORY ] == iComponent )
{
if ( iItem == x++ )
{
model = g_vehicleComponentsData[ i ] [ E_MODEL_ID ];
}
}
new
Float: X, Float: Y, Float: Z;
p_VehiclePreviewTD[ 0 ] = CreatePlayerTextDraw(playerid,289.000000, 230.000000, "preview 2");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 0 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 0 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 0 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 0 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 0 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 0 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 0 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 0 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 0 ], -16.000000, 0.000000, 0.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 0 ], 0);
GivePlayerCash( playerid, -g_vehicleComponentsData[ i ] [ E_PRICE ] );
p_VehiclePreviewTD[ 1 ] = CreatePlayerTextDraw(playerid,358.000000, 160.000000, "preview 3");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 1 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 1 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 1 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 1 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 1 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 1 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 1 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 1 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 1 ], -16.000000, 0.000000, 270.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 1 ], 0);
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_CREATED ] [ slotid ] = true;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_DISABLED ] [ slotid ] = false;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ slotid ] = g_vehicleComponentsData[ i ] [ E_MODEL_ID ];
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_X ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Y ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Z ] [ slotid ] = 1.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RX ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RY ] [ slotid ] = 0.0;
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RZ ] [ slotid ] = 0.0;
p_VehiclePreviewTD[ 2 ] = CreatePlayerTextDraw(playerid,358.000000, 230.000000, "preview 4");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 2 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 2 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 2 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 2 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 2 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 2 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 2 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 2 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 2 ], -16.000000, 0.000000, 90.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 2 ], 0);
format( szNormalString, sizeof( szNormalString ), "INSERT INTO `COMPONENTS` (`VEHICLE_ID`,`MODEL`,`X`,`Y`,`Z`,`RX`,`RY`,`RZ`) VALUES (%d,%d,0.0,0.0,1.0,0.0,0.0,0.0)", g_vehicleData[ ownerid ] [ vehicleid ] [ E_SQL_ID ], g_vehicleComponentsData[ i ] [ E_MODEL_ID ] );
mysql_function_query( dbHandle, szNormalString, true, "OnPlayerCreateVehicleComponent", "ddd", playerid, vehicleid, slotid );
p_VehiclePreviewTD[ 3 ] = CreatePlayerTextDraw(playerid,428.000000, 160.000000, "preview 4");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 3 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 3 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 3 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 3 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 3 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 3 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 3 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 3 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 3 ], 270.000000, 0.000000, 0.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 3 ], 0);
GetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z );
SetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z + 0.05 );
p_VehiclePreviewTD[ 4 ] = CreatePlayerTextDraw(playerid,428.000000, 230.000000, "preview 5");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 4 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 4 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 4 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 4 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 4 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 4 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 4 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 4 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 4 ], 90.000000, 0.000000, 0.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 4 ], 0);
g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ slotid ] = CreateDynamicObject( g_vehicleComponentsData[ i ] [ E_MODEL_ID ], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .worldid = GetVehicleVirtualWorld( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ]) );
AttachDynamicObjectToVehicle( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ slotid ], g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 );
return SendServerMessage( playerid, "You have bought a "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_vehicleComponentsData[ i ] [ E_NAME ], cash_format( g_vehicleComponentsData[ i ] [ E_PRICE ] ) );
p_VehiclePreviewTD[ 5 ] = CreatePlayerTextDraw(playerid,150.000000, 160.000000, "big preview");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 5 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 5 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 5 ], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 5 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 5 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 5 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 5 ], 130.000000, 130.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 5 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 5 ], -16.000000, 0.000000, 45.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,p_VehiclePreviewTD[ 5 ], 0);
p_VehiclePreviewTD[ 6 ] = CreatePlayerTextDraw(playerid,289.000000, 160.000000, "preview 6");
PlayerTextDrawBackgroundColor(playerid,p_VehiclePreviewTD[ 6 ], 112);
PlayerTextDrawFont(playerid,p_VehiclePreviewTD[ 6 ], 5);
PlayerTextDrawLetterSize(playerid,p_VehiclePreviewTD[ 6 ], 0.500000, 4.400000);
PlayerTextDrawColor(playerid,p_VehiclePreviewTD[ 6 ], -1);
PlayerTextDrawUseBox(playerid,p_VehiclePreviewTD[ 6 ], 1);
PlayerTextDrawBoxColor(playerid,p_VehiclePreviewTD[ 6 ], 0);
PlayerTextDrawTextSize(playerid,p_VehiclePreviewTD[ 6 ], 60.000000, 60.000000);
PlayerTextDrawSetPreviewModel(playerid, p_VehiclePreviewTD[ 6 ], model);
PlayerTextDrawSetPreviewRot(playerid, p_VehiclePreviewTD[ 6 ], -16.000000, 0.000000, 180.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid, p_VehiclePreviewTD[ 6 ], 0);
TextDrawShowForPlayer( playerid, g_VehiclePreviewBoxTD );
TextDrawSetString( g_VehiclePreviewTxtTD, "Component Preview" );
TextDrawShowForPlayer( playerid, g_VehiclePreviewTxtTD );
TextDrawShowForPlayer( playerid, p_VehiclePreviewCloseTD );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 0 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 1 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 2 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 3 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 4 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 5 ] );
PlayerTextDrawShow( playerid, p_VehiclePreviewTD[ 6 ] );
p_inMovieMode{ playerid } = false;
cmd_moviemode( playerid, "" ); // Hide textdraws :3
SelectTextDraw( playerid, COLOR_RED );
SetPVarInt( playerid, "viewing_component", 1 );
}
}
}
@ -690,3 +824,36 @@ stock ShowVehicleComponentCategories( playerid )
}
return ShowPlayerDialog( playerid, DIALOG_COMPONENTS_CATEGORY, DIALOG_STYLE_LIST, "Pimp My Ride - Categories", szCategory, "Select", "Cancel" );
}
hook OnPlayerClickTextDraw(playerid, Text: clickedid)
{
// Pressed ESC
if ( clickedid == Text: INVALID_TEXT_DRAW ) {
if ( GetPVarInt( playerid, "recently_previewed" ) < GetTickCount( ) && GetPVarInt( playerid, "viewing_component" ) )
return CancelComponentView( playerid, 0 );
}
return 1;
}
stock CancelComponentView( playerid, cancel = 1 )
{
if ( cancel )
CancelSelectTextDraw( playerid );
TextDrawHideForPlayer( playerid, g_VehiclePreviewBoxTD );
TextDrawHideForPlayer( playerid, g_VehiclePreviewTxtTD );
TextDrawHideForPlayer( playerid, p_VehiclePreviewCloseTD );
for( new i; i < sizeof p_VehiclePreviewTD; i++ )
PlayerTextDrawDestroy( playerid, p_VehiclePreviewTD[ i ] );
cmd_moviemode( playerid, "" ); // Show textdraws :3
DeletePVar( playerid, "viewing_component" );
SetPVarInt( playerid, "recently_previewed", GetTickCount( ) + 100 );
SendServerMessage( playerid, "You have finished looking at this vehicle modification preview." );
return ShowPlayerDialog(playerid, DIALOG_COMPONENTS_RESPONSE, DIALOG_STYLE_LIST, ""COL_WHITE"Pimp My Ride", "Purchase Component\nPreview Component", "Select", "Back" );
}

View File

@ -1463,6 +1463,8 @@ public OnPlayerEditDynamicObject( playerid, objectid, response, Float:x, Float:y
ShowPlayerDialog( playerid, DIALOG_FURNITURE, DIALOG_STYLE_LIST, "{FFFFFF}Furniture", "Purchase Furniture\nSelect Furniture Easily\nSelect Furniture Manually\nSelect Furniture Nearest\n"COL_RED"Remove All Furniture", "Confirm", "Back" );
}
}
return 1;
}
@ -5338,7 +5340,7 @@ CMD:irresistiblecoins( playerid, params[ ] )
CMD:top( playerid, params[ ] ) return cmd_highscores( playerid, params );
CMD:highscores( playerid, params[ ] )
{
ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies", "Select", "Close" );
ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults", "Select", "Close" );
return 1;
}
@ -8870,7 +8872,7 @@ CMD:takeover( playerid, params[ ] )
GetZoneFromCoordinates( szLocation, min_x, min_y );
SendClientMessageToGang( g_gangTurfData[ z ] [ E_OWNER ], g_gangData[ g_gangTurfData[ z ] [ E_OWNER ] ] [ E_COLOR ], "[GANG]{FFFFFF} Our territory at %s is being attacked by "COL_GREY"%s"COL_WHITE", defend it!", g_gangData[ g_gangzoneAttacker[ z ] ] [ E_NAME ] );
SendClientMessageToGang( g_gangTurfData[ z ] [ E_OWNER ], g_gangData[ g_gangTurfData[ z ] [ E_OWNER ] ] [ E_COLOR ], "[GANG]"COL_WHITE" Our territory is being attacked by "COL_GREY"%s"COL_WHITE" in %s, defend it!", g_gangData[ g_gangzoneAttacker[ z ] ] [ E_NAME ], szLocation );
}
}
else
@ -9886,15 +9888,54 @@ public OnPlayerDriveVehicle( playerid, vehicleid )
format( szSmallString, sizeof( szSmallString ), "vburg_%d_items", vehicleid );
if ( GetGVarInt( szSmallString ) > 0 )
{
new
Float: X, Float: Y, Float: Z,
Float: pX, Float: pY, Float: pZ;
GetPlayerPos( playerid, pX, pY, pZ );
Beep( playerid );
GameTextForPlayer( playerid, "Go to the truck blip on your radar for money!", 3000, 1 );
SendServerMessage( playerid, "Note! You have %d stolen goods that you can export for money!", GetGVarInt( szSmallString ) );
static aPlayer[ 1 ]; aPlayer[ 0 ] = playerid;
DestroyDynamicMapIcon( p_PawnStoreMapIcon[ playerid ] );
p_PawnStoreMapIcon[ playerid ] = CreateDynamicMapIconEx( -2480.2461, 6.0720, 25.6172, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer );
static
szCity[ MAX_ZONE_NAME ],
aPlayer[ 1 ];
p_PawnStoreExport[ playerid ] = CreateDynamicRaceCP( 1, -2480.2461, 6.0720, 25.6172, 0.0, 0.0, 0.0, 4.0, -1, -1, playerid );
aPlayer[ 0 ] = playerid;
DestroyDynamicMapIcon( p_PawnStoreMapIcon[ playerid ] );
//static ;
// San Fierro only
// Get2DCity( szCity, g_houseData[ i ] [ E_EX ], g_houseData[ i ] [ E_EY ], g_houseData[ i ] [ E_EZ ] );
// if ( ! strmatch( szCity, "San Fierro" ) ) {
// ignoredHomes[ i ] = i;
// continue;
// }
Get2DCity( szCity, pX, pY, pZ );
if ( strmatch( szCity, "San Fierro" ) )
{
X = -2480.2461;
Y = 6.0720;
Z = 25.6172;
}
else if ( strmatch( szCity, "Los Santos" ) )
{
X = 2522.1677;
Y = -1717.4137;
Z = 13.6086;
}
else if ( strmatch( szCity, "Las Venturas" ) )
{
X = 2481.6812;
Y = 1315.8477;
Z = 10.6797;
}
p_PawnStoreMapIcon[ playerid ] = CreateDynamicMapIconEx( X, Y, Z, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer );
p_PawnStoreExport[ playerid ] = CreateDynamicRaceCP( 1, X, Y, Z, 0.0, 0.0, 0.0, 4.0, -1, -1, playerid );
}
}
@ -11415,7 +11456,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
// taze mechanism
else if ( PRESSED( KEY_LOOK_BEHIND ) )
{
if ( p_Class[ playerid ] == CLASS_POLICE )
if ( p_Class[ playerid ] == CLASS_POLICE && p_AntiSpawnKillEnabled{ playerid })
{
new
closestid = GetClosestPlayer( playerid );
@ -14352,10 +14393,25 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
// total robberies
case 4: mysql_function_query( dbHandle, "SELECT `NAME`, `ROBBERIES` as `SCORE_VAL` FROM `USERS` ORDER BY `ROBBERIES` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 4 );
// hits completed
case 5: mysql_function_query( dbHandle, "SELECT `NAME`, `CONTRACTS` as `SCORE_VAL` FROM `USERS` ORDER BY `CONTRACTS` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 5 );
// fires
case 6: mysql_function_query( dbHandle, "SELECT `NAME`, `FIRES` as `SCORE_VAL` FROM `USERS` ORDER BY `FIRES` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 6 );
// burglaries
case 7: mysql_function_query( dbHandle, "SELECT `NAME`, `BURGLARIES` as `SCORE_VAL` FROM `USERS` ORDER BY `BURGLARIES` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 7 );
// blown jails
case 8: mysql_function_query( dbHandle, "SELECT `NAME`, `BLEW_JAILS` as `SCORE_VAL` FROM `USERS` ORDER BY `BLEW_JAILS` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 8 );
// blown vaults
case 9: mysql_function_query( dbHandle, "SELECT `NAME`, `BLEW_VAULT` as `SCORE_VAL` FROM `USERS` ORDER BY `BLEW_VAULT` DESC LIMIT 25", true, "OnHighScoreCheck", "ii", playerid, 9 );
}
}
if ( dialogid == DIALOG_HIGHSCORES_BACK && ! response ) {
return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies", "Select", "Close" );
return ShowPlayerDialog( playerid, DIALOG_HIGHSCORES, DIALOG_STYLE_LIST, "{FFFFFF}Highscores", "Seasonal Rank\nTotal Score\nTotal Kills\nTotal Arrests\nTotal Robberies\nHits Completed\nFires Extinguished\nBurglaries\nBlown Jails\nBlown Vaults", "Select", "Close" );
}
return 1;
}
@ -14381,6 +14437,11 @@ thread OnHighScoreCheck( playerid, highscore_item )
case 2: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Kills\n", szSmallString = "Top 25 Kills";
case 3: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Arrests\n", szSmallString = "Top 25 Arrests";
case 4: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Robberies\n", szSmallString = "Top 25 Robberies";
case 5: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Contracts\n", szSmallString = "Top 25 Hits Completed";
case 6: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Fires\n", szSmallString = "Top 25 Fires Extinguished";
case 7: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Burglaries\n", szSmallString = "Top 25 Burglaries";
case 8: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Jailes\n", szSmallString = "Top 25 Blown Jails";
case 9: szLargeString = ""COL_GOLD"Player\t"COL_GOLD"Vaults\n", szSmallString = "Top 25 Blown Vaults";
}
for ( new row = 0; row < rows; row ++ )
@ -15792,7 +15853,7 @@ stock GetRandomCreatedHouse( )
return -1;
}
static szCity[ MAX_ZONE_NAME ];
//static szCity[ MAX_ZONE_NAME ];
new ignoredHomes[ MAX_HOUSES ] = { -1, ... };
// first find homes to ignore
@ -15811,11 +15872,11 @@ stock GetRandomCreatedHouse( )
}
// San Fierro only
Get2DCity( szCity, g_houseData[ i ] [ E_EX ], g_houseData[ i ] [ E_EY ], g_houseData[ i ] [ E_EZ ] );
if ( ! strmatch( szCity, "San Fierro" ) ) {
ignoredHomes[ i ] = i;
continue;
}
// Get2DCity( szCity, g_houseData[ i ] [ E_EX ], g_houseData[ i ] [ E_EY ], g_houseData[ i ] [ E_EZ ] );
// if ( ! strmatch( szCity, "San Fierro" ) ) {
// ignoredHomes[ i ] = i;
// continue;
// }
}
new