From 307247f6e978f61dffd47fe7e0b59391a80eb414 Mon Sep 17 00:00:00 2001 From: Pichai Lertwachirakul <46616744+zekodef@users.noreply.github.com> Date: Tue, 1 Oct 2019 14:09:30 +0700 Subject: [PATCH 1/3] Skip VIP level checking for non-VIP user --- gamemodes/sf-cnr.pwn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 62951a8..1c03809 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -818,10 +818,12 @@ public OnPlayerSpawn( playerid ) SetPlayerColorToTeam( playerid ); SetPlayerVirtualWorld( playerid, 0 ); - if ( p_VIPLevel[ playerid ] >= VIP_REGULAR && p_VIPWep1{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep1{ playerid }, 200 ); - if ( p_VIPLevel[ playerid ] >= VIP_GOLD && p_VIPWep2{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep2{ playerid }, 200 ); - if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPWep3{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep3{ playerid }, 200 ); - if ( p_VIPLevel[ playerid ] >= VIP_GOLD ) SetPlayerArmour( playerid, 100.0 ); // Free armour on spawn. + if ( p_VIPLevel[ playerid ] >= VIP_REGULAR ){ + if ( p_VIPLevel[ playerid ] >= VIP_REGULAR && p_VIPWep1{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep1{ playerid }, 200 ); + if ( p_VIPLevel[ playerid ] >= VIP_GOLD && p_VIPWep2{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep2{ playerid }, 200 ); + if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPWep3{ playerid } != 0 ) GivePlayerWeapon( playerid, p_VIPWep3{ playerid }, 200 ); + if ( p_VIPLevel[ playerid ] >= VIP_GOLD ) SetPlayerArmour( playerid, 100.0 ); // Free armour on spawn. + } CallLocalFunction( "SetPlayerRandomSpawn", "d", playerid ); From 52fe146e93b4dcddd9a2339d08e1045217333fec Mon Sep 17 00:00:00 2001 From: Pichai Lertwachirakul <46616744+zekodef@users.noreply.github.com> Date: Tue, 1 Oct 2019 14:16:26 +0700 Subject: [PATCH 2/3] remove no colum data from SQL query XP colum data has been removed from SQL database. --- gamemodes/sf-cnr.pwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 1c03809..a084bb0 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -114,7 +114,7 @@ public OnGameModeInit() mysql_function_query( dbHandle, "UPDATE USERS SET VIP_PACKAGE=0, VIP_EXPIRE=0 WHERE UNIX_TIMESTAMP() > VIP_EXPIRE AND VIP_EXPIRE != 0", true, "onRemoveInactiveRows", "d", 1 ); // Truncate accounts older than 2 months - mysql_function_query( dbHandle, "UPDATE USERS SET CASH=0,BANKMONEY=0,COINS=0.0,XP=0 WHERE UNIX_TIMESTAMP()-`LASTLOGGED`>5259487", true, "onRemoveInactiveRows", "d", 2 ); + mysql_function_query( dbHandle, "UPDATE USERS SET CASH=0,BANKMONEY=0,COINS=0.0 WHERE UNIX_TIMESTAMP()-`LASTLOGGED`>5259487", true, "onRemoveInactiveRows", "d", 2 ); // Remove inactive homes older than 2 weeks mysql_function_query( dbHandle, "DELETE a2,a3 FROM `USERS` a1 " \ From 44b9b1d1e396e01e52dd4f25919d74fe5eff8a4a Mon Sep 17 00:00:00 2001 From: Pichai Lertwachirakul <46616744+zekodef@users.noreply.github.com> Date: Tue, 1 Oct 2019 14:22:18 +0700 Subject: [PATCH 3/3] Fix mining face position Fixed : https://github.com/zeelorenc/sf-cnr/issues/64 Reported-by: Stanislav Gromov ( Daniel-Cortez ) Signed-off-by: Pichai Lertwachirakul ( zekodef ) --- gamemodes/irresistible/cnr/features/minijobs/mining.pwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn index c6508a7..14de165 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/mining.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/mining.pwn @@ -272,6 +272,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { static Float: X, Float: Y, Float: Z; + static Float: offset = 0.0; foreach ( new m : miningrock ) { @@ -283,7 +284,8 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) if ( g_miningData[ m ] [ E_ORES ] <= 0 ) return SendError( playerid, "There are no ores left in this rock." ); - SetPlayerFacePoint( playerid, X, Y, Z ); + GetDynamicObjectPos( g_miningData[ m ] [ E_OBJECT ], X, Y, Z ); + SetPlayerFacePoint( playerid, X, Y, offset ); SetPlayerMineOre( playerid, m ); SendServerMessage( playerid, "You're now mining a rock." ); return 1;