Merge pull request #80 from zekodef/master
Bug fixes and Skip VIP level checking for non-VIP users
This commit is contained in:
commit
f62c4940b3
@ -272,6 +272,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
|||||||
{
|
{
|
||||||
static
|
static
|
||||||
Float: X, Float: Y, Float: Z;
|
Float: X, Float: Y, Float: Z;
|
||||||
|
static Float: offset = 0.0;
|
||||||
|
|
||||||
foreach ( new m : miningrock )
|
foreach ( new m : miningrock )
|
||||||
{
|
{
|
||||||
@ -283,7 +284,8 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
|||||||
if ( g_miningData[ m ] [ E_ORES ] <= 0 )
|
if ( g_miningData[ m ] [ E_ORES ] <= 0 )
|
||||||
return SendError( playerid, "There are no ores left in this rock." );
|
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 );
|
SetPlayerMineOre( playerid, m );
|
||||||
SendServerMessage( playerid, "You're now mining a rock." );
|
SendServerMessage( playerid, "You're now mining a rock." );
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -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 );
|
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
|
// 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
|
// Remove inactive homes older than 2 weeks
|
||||||
mysql_function_query( dbHandle, "DELETE a2,a3 FROM `USERS` a1 " \
|
mysql_function_query( dbHandle, "DELETE a2,a3 FROM `USERS` a1 " \
|
||||||
@ -818,10 +818,12 @@ public OnPlayerSpawn( playerid )
|
|||||||
SetPlayerColorToTeam( playerid );
|
SetPlayerColorToTeam( playerid );
|
||||||
SetPlayerVirtualWorld( playerid, 0 );
|
SetPlayerVirtualWorld( playerid, 0 );
|
||||||
|
|
||||||
|
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_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_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_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_GOLD ) SetPlayerArmour( playerid, 100.0 ); // Free armour on spawn.
|
||||||
|
}
|
||||||
|
|
||||||
CallLocalFunction( "SetPlayerRandomSpawn", "d", playerid );
|
CallLocalFunction( "SetPlayerRandomSpawn", "d", playerid );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user