I made this function
Code: [Select]
And This Command
Code: [Select]
when i type !buyvip i have everything coins and get logged in it show last PRIVMESSAGE and when i go to database it show True
but when i type !vip
It Show no VIP Online
Code: [Select]
and also use this
Code: [Select]
But when i spawn It is True in db VIP but It Didn't kill me Why?
Code: [Select]
function SetVIP( player, amount )
{
QuerySQL(sqliteDB, "UPDATE Accounts SET VIP='" + amount + "' WHERE Name='" + player.Name + "'");
}
function GetVIP( player )
{
local lvl1 = GetSQLColumnData( QuerySQL( sqliteDB, "SELECT VIP FROM Accounts WHERE Name='" + player.Name+"'" ), 0 );
if ( lvl1 ) return lvl1;
else return 0;
}
And This Command
if ( cmd == "buyvip")
{
if ( pstats[ player.ID ].Logged == false ) PrivMessage( player, "You are not logged in");
else if ( GetCoins( player ) <= 1000 ) PrivMessage( player, "You need to have atleast 1000 BFME Coints for VIP");
else
{
QuerySQL(sqliteDB, "UPDATE Accounts SET VIP= 'true' WHERE Name='" + player.Name + "'");
SetCoins( player, GetCoins( player ) - 1000 );
PrivMessage( player, "Congratulation You Become New VIP");
Message( " " + player.Name + "has become New VIP of a Server");
}
}
when i type !buyvip i have everything coins and get logged in it show last PRIVMESSAGE and when i go to database it show True
but when i type !vip
It Show no VIP Online
else if ( ( cmd == "vip" ) || ( cmd == "vip" ) )
{
local plr, b;
for( local i = 0; i < GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( GetVIP( plr ) == true ) )
{
if ( b ) b = b + ", " + plr.Name + " "
else b = plr.Name + " "
}
}
if ( b ) Message( "**In Game[ VIP Online: [ " + b + " ] ]" );
else Message( "** In Game [ No VIP Online ]." );
}
and also use this
function onPlayerSpawn( player )
{
if ( GetVIP( player ) == true ) player.Health = 0;
}
But when i spawn It is True in db VIP but It Didn't kill me Why?