Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

[Tutorial] Simple Advise System

$
0
0
Simple Advise System

Hello there!

To make your server more full and a bit better u can create small tips, or advises, or just smth like "Like this server? Add us in favorites"

If u are the professional super high scripter u can leave this thread, or don't be so rude to simple tutorials :)

To all new add variable
PHP Code:

new tips

After that create new public
PHP Code:

forward ShowTips(); // for timer
public ShowTips()
{
    switch( 
tips // Using switch operator is best way here
    
{
         case 
0// if our var -> tips == 0 (case 0)
         
{
                  
SendClientMessageToAll(-1"SERVER: Welcome To My Server");
                  
tips 1// Next time it will send message that is in case 1
         
}
         case 
1// tips == 1
         
{
                  
SendClientMessageToAll(-1"Add our server to favorites! IP:Port");
                  
tips 2// after 10 minute -> case 2
         
}
         case 
2// tips == 2
         
{
                  
SendClientMessageToAll(-1"If you have found bug, tell about them to /admins");
                  
tips 3;
         }
         case 
3// tips == 3
         
{
                  
SendClientMessageToAll(-1"Visit our forums: website.com");
                  
tips 0// In the last use var = 0, to repeat...
         
}
    }
    return 
1;


now go to OnGameModeInit and indicate our variables
PHP Code:

tips 0// when timers is activated it will use case 0, because tips == 0
SetTimer("ShowTips"10*60*10001); // Every 10 minutes server will send message to all 

Very simple system, for newbies, beginners.
Thanks you :)

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>