[Tutorial] Randoms (mapname,hostname,gamemodetext)
#1

Hello fellow San-Andreas multiplayer, here is my first tutorials in the English sections about how to change your map name, hostname, game modes with a simple timer, I will try to do my best so you will able to understand what I want to mean with my bad English.




INTRODUCTIONS :

pawn Code:
/*====================================================================================*
 ______                  _                                                            |
(_____ \                | |                                                           |
 _____) )_____ ____   __| | ___  ____                                                 |
|  __  /(____ |  _ \ / _  |/ _ \|    \  | Just beacause, we don't know how to do :    |
| |  \ \/ ___ | | | ( (_| | |_| | | | | | =======================================     |
|_|   |_\_____|_| |_|\____|\___/|_|_|_| | a random (Mapname ; Hostname ; Gamemodes)   |
                                                                                      |
--------------------------------------------------------------------------------------|
                            -> TUTORIALS by thegreathom <-                            |
*=====================================================================================*/
So, with this tutorials I will learn you how to simply have randoms names (map,gamemodes,hostname) it's simply to do... If you don't understand replies to this thread and don't send me private message :') but normaly you will understand, well have fun.

Some screenshots :
-

TUTORIALS (scripting) :

1) Top of your script :
pawn Code:
// Credits to our so smexy samp team for this includes.
#include <a_samp>
2) OnFilterScriptInit or OnGameModeInit :
pawn Code:
public OnFilterScriptInit()
{
    SetTimer("RandomsSET",10000, true); // Each (10000ms) = 10seconds (map,hostname,gamemode) change.
    return 1;
}
3) Mapname, hostname, gamemodetext settings:
pawn Code:
forward RandomsSET();
public RandomsSET()
{
   switch (random(2)) // (2) = The numbers of randoms hostname I have you can change it :
// Add : case 2: SendRconCommand("hostname MYTEXT");
   {
//==================================================[Hostname]
//   Don't remove "hostname" just change "MY TEXT to your"
     case 0: SendRconCommand("hostname MYTEXT");
     case 1: SendRconCommand("hostname MYTEXT");
   }
//==================================================[Mapname]
   switch (random(3)) // (3) = The numbers of randoms hostname I have you can change it :
// Add : case 4: SendRconCommand("mapname MYTEXT");
   {
//   Don't remove "mapname" just change "MY TEXT to your"
     case 0: SendRconCommand("mapname MYTEXT");
     case 1: SendRconCommand("mapname MYTEXT");
     case 2: SendRconCommand("mapname MYTEXT");
   }
//==================================================[Gamemodetext]
   switch (random(2)) // (2) = The numbers of randoms hostname I have you can change it :
// Add : case 3: SendRconCommand("mapname MYTEXT");
   {
//   Don't remove "gamemodetext" just change "MY TEXT to your"
     case 0: SendRconCommand("gamemodetext MYTEXT");
     case 1: SendRconCommand("gamemodetext MYTEXT");
   }
SO, WE WILL HAVE THIS :
pawn Code:
#include <a_samp>

public OnFilterScriptInit()
{
    SetTimer("RandomsSET",1000, true);

    return 1;
}

forward RandomsSET();
public RandomsSET()
{
   switch (random(2))
   {
     case 0: SendRconCommand("hostname My servers is so great");
     case 1: SendRconCommand("hostname Thegreathom the nice & smexy");
   }

   switch (random(3))
   {
     case 0: SendRconCommand("mapname THEGREATSAM");
     case 1: SendRconCommand("mapname SONICE");
     case 2: SendRconCommand("mapname SOSEXY");
   }

   switch (random(2))
   {
     case 0: SendRconCommand("gamemodetext THEGREATHOM");
     case 1: SendRconCommand("gamemodetext IS SO SMEXY");
   }

   return 1;
}
I hope this tutorials help you guys.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)