Helping Messages.

Started by Gito Baloch, Mar 04, 2020, 03:36 PM

Previous topic - Next topic

Gito Baloch

lastElement <- 0;
myArray <- [
"Dont Forget to Add this server in your Favorites Tab",
"Use /help if you are a newbie in this Server",
"[#bae3ff]Check [#12d449]/cmds [#bae3ff]for a full list of commands that you can use.",
"[#bae3ff]Don't forget to visit our forums (Your Forum Name)",
"[#bae3ff]Dont use hacks as it can lead to ban",
"[#bae3ff]Wanna be a Member of the Staff,Post an application on our Forums ",
];

function Messages()
{
    local currentString = myArray[lastElement];
    lastElement++;

    if( lastElement > ( myArray.len() - 1 ) ) // array.len() - 1 would be the last index
        lastElement = 0; // reset to 0

Message( currentString );
}

NewTimer( "Messages", 30000, 0 );
Programming is the language I speak, the world I shape, and the future I code

mafiadz02

pc spec pentium 4 and 2gb ram and windows 10 32 bit and iam using it cuz iam like  coding

Gito Baloch

Programming is the language I speak, the world I shape, and the future I code

NicusorN5

Really neat way for help messages! I was always using a RNG.