Advertisement
Guest User

Untitled

a guest
Jan 7th, 2020
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. task TwentySecondsTimer[ 20000 ]( ) {
  2. new query[ 256 ];
  3.  
  4. mysql_format( SQL, query, sizeof query, "SELECT * FROM `billboards` WHERE `time` < '%d' AND `time`!='0' ORDER BY `ID", gettime( ) );
  5. mysql_tquery( SQL, query, "checkExpireBillboard", "" );
  6. return true; }
  7.  
  8. function checkExpireBillboard( ) {
  9. if( cache_get_row_count( ) > 0 ) {
  10. new billid, ownerbill[ 64 ], query[ 256 ];
  11. billid = cache_get_field_content_int( 0, "ID" );
  12. cache_get_field_content( 0, "BillOwner", ownerbill, SQL, 64 );
  13. format( bBill[ billid ][ bBillOwner ], 64, "AdmBot" );
  14. format( bBill[ billid ][ bBillText ], 128, "Your text here!" );
  15. bBill[ billid ][ bBillTime ] = 0;
  16. bBill[ billid ][ bBillTextSize ] = 25;
  17. DestroyBillBoard( billid );
  18. foreach( new id: Player ) {
  19. if( strcmp( PlayerInfo[ id ][ pNormalName ], ownerbill, true ) == 0 ) {
  20. PlayerInfo[ id ][ pBillboard ] = 0;
  21. SCMf( id, -1, "You billboard %d was expired. ", billid );
  22. }
  23. }
  24. mysql_format( SQL, query, sizeof query, "UPDATE `users` SET `Billboard` = '0' WHERE `name` = '%s'", ownerbill );
  25. mysql_tquery( SQL, query, "", "" );
  26.  
  27. mysql_format( SQL, query, sizeof query, "UPDATE `billboards` SET `BillOwner`='AdmBot',`BillText`='bluffs.ro',`time`='0',`BillTextSize`='25' WHERE `ID`='%d'", billid );
  28. mysql_tquery( SQL, query, "", "" );
  29. }
  30. return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement