Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task TwentySecondsTimer[ 20000 ]( ) {
- new query[ 256 ];
- mysql_format( SQL, query, sizeof query, "SELECT * FROM `billboards` WHERE `time` < '%d' AND `time`!='0' ORDER BY `ID", gettime( ) );
- mysql_tquery( SQL, query, "checkExpireBillboard", "" );
- return true; }
- function checkExpireBillboard( ) {
- if( cache_get_row_count( ) > 0 ) {
- new billid, ownerbill[ 64 ], query[ 256 ];
- billid = cache_get_field_content_int( 0, "ID" );
- cache_get_field_content( 0, "BillOwner", ownerbill, SQL, 64 );
- format( bBill[ billid ][ bBillOwner ], 64, "AdmBot" );
- format( bBill[ billid ][ bBillText ], 128, "Your text here!" );
- bBill[ billid ][ bBillTime ] = 0;
- bBill[ billid ][ bBillTextSize ] = 25;
- DestroyBillBoard( billid );
- foreach( new id: Player ) {
- if( strcmp( PlayerInfo[ id ][ pNormalName ], ownerbill, true ) == 0 ) {
- PlayerInfo[ id ][ pBillboard ] = 0;
- SCMf( id, -1, "You billboard %d was expired. ", billid );
- }
- }
- mysql_format( SQL, query, sizeof query, "UPDATE `users` SET `Billboard` = '0' WHERE `name` = '%s'", ownerbill );
- mysql_tquery( SQL, query, "", "" );
- mysql_format( SQL, query, sizeof query, "UPDATE `billboards` SET `BillOwner`='AdmBot',`BillText`='bluffs.ro',`time`='0',`BillTextSize`='25' WHERE `ID`='%d'", billid );
- mysql_tquery( SQL, query, "", "" );
- }
- return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement