Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QuerySQL(db, "CREATE TABLE IF NOT EXISTS VIP(Name TEXT, Time NUMERIC DEFAULT 0, TimeExp NUMERIC DEFAULT 0 ) );
- VIP = false;
- VIPExp = 0;
- else if ( cmd == "buyvip")
- {
- if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
- else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
- else if ( !text ) ErrorMessage( "Syntax: /" + cmd + " <days>", player );
- else if ( IsNoob( player, cmd ) ) return 0;
- else
- {
- local duration = duration(GetTok( text, " ", 1));
- if (!duration) ErrorMessage( "Syntax: /" + cmd + " <days>", player );
- else
- {
- VIP( player, duration);
- }
- }
- }
- function VIP( player, duration )
- {
- local g_time, duration_type;
- switch( duration.len() )
- {
- case 2: //this is for slicing the type of 1d
- g_time = duration.slice(0,1);
- duration_type = duration.slice(1,2);
- break;
- case 3: //this is for slicing the type of 10d,10h,10m
- g_time = duration.slice(0,2);
- duration_type = duration.slice(2,3);
- break;
- }
- default:
- ErrorMessage( "Invalid Duration", player );
- {
- local g_time_, g_duration_type_;
- switch( duration_type )
- {
- case "d":
- g_time_ = g_timeexp.tointeger() * 86400;
- g_duration_type_ = "day(s)";
- break;
- default:
- SendMessage( "Invalid format, the format you typed is wrong", player );
- }
- local dur = g_time + " " + g_duration_type_;
- SendMessage( "[VIP] - You have purchased the vip pack for " + dur + ".", player );
- QuerySQL(db, "INSERT INTO VIP ( Name, Time, TimeExp ) VALUES ( '"+player.Name+"', '"+time()+"', '"+g_timeexp_+"'" );
- }
- }
Add Comment
Please, Sign In to add comment