[Tutorial] How to create Simple Random Messages.
#1

Delete this.
Reply
#2

Your explanations could be even more resolving though. For example:
pawn Code:
public MensajesRamdom()//Public what sends the messages
Yes, it can be explained like that, but I'd explain it like this:
pawn Code:
public MensajesRamdom()//Callback that sends the messages
as the term isn't public (people will understand it) but the term is callback, so I'd use it.
Else, it's a good tutorial.
Reply
#3

Quote:
Originally Posted by CookieJar
View Post
Your explanations could be even more resolving though. For example:
pawn Code:
public MensajesRamdom()//Public what sends the messages
Yes, it can be explained like that, but I'd explain it like this:
pawn Code:
public MensajesRamdom()//Callback that sends the messages
as the term isn't public (people will understand it) but the term is callback, so I'd use it.
Else, it's a good tutorial.
He's right btw cookiejar u finally got some rep huh
Reply
#4

Quote:
Originally Posted by §с†¶e®РµРe
View Post
He's right btw cookiejar u finally got some rep huh
Yeah, for reason "GO DIE YOU FUCKING FAGGOT".
EDIT: I know I'm right =)

OT: Else, this is a good tutorial.
Reply
#5

You havent defined MensajesRamdom() ,you defined RandomMessages().
Reply
#6

C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(205 ) : error 021: symbol already defined: "RandomMessages"
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 028: invalid subscript (not an array or too many subscripts): "RandomMessages"
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 072: "sizeof" operator is invalid on "function" symbols
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 029: invalid expression, assumed zero
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#7

Relly good
Reply
#8

Quote:
Originally Posted by John Rockie
View Post
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(205 ) : error 021: symbol already defined: "RandomMessages"
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 028: invalid subscript (not an array or too many subscripts): "RandomMessages"
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 072: "sizeof" operator is invalid on "function" symbols
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : error 029: invalid expression, assumed zero
C:\Users\JUAN\Desktop\samp03\gamemodes\ww2.pwn(206 ) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
:S, for me works perfectly, neabe your gm have any simbol defined, try to test this in a blank script.
Reply
#9

Quote:
Originally Posted by [Nikk]
View Post
:S, for me works perfectly, neabe your gm have any simbol defined, try to test this in a blank script.
i get same problem that John Rockie get
Reply
#10

You should see this tutorial.
Reply
#11

pawn Code:
#include <a_samp>

new RandomMessagesList[][] =//We create a variable || Not the same Name as the Callback we created
{//open
        "TIP: Visit our forums! www.lala.lala",//Example Message
        "Forum sa:mp it's the best web ever!",//Example Messge
        "I love mi mom :D"//This is the last message, in the last message dont put a " , " in the end.
};//Close

public OnFilterScriptInit()
{
    SetTimer("RandomMessages", 120000, true);// 2 minutes for message
    return 1;
}

forward RandomMessages();//This will be the forward
public RandomMessages()//Public what sends the messages
{
    SendClientMessageToAll(0xFF0000FF, RandomMessagesList[random(sizeof(RandomMessagesList))]);//Function what send the messages, with timer, and messages info. || Random from the variable with the Message List.
}
Reply
#12

Quote:
Originally Posted by CookieJar
View Post
this is a good tutorial.
Obvious troll is obvious.
Reply
#13

Nikk iam dissapointed of you! bad tut
Reply
#14

I know this is your tutorial, and I don't mean to hijack your topic, but I just felt the need to show you how I personally would do it.

pawn Code:
//At the top of your script, near your other definitions -
#define     RANDOM_MESSAGE1     "This is random message numero uno!"
    #define     RANDOM_MESSAGE2     "This is random message numero dos!"
        #define     RANDOM_MESSAGE3     "This is random message numero tres!"
            #define     RANDOM_MESSAGETIMEINMINUTES     3 //Every three minutes a random message will be shown.

//OnGameModeInit / OnFilterScriptInit -

SetTimer("ShowARandomMessage", RANDOM_MESSAGETIMEINMINUTES*60000, true); //3 * 60000 = 180,000 milliseconds which translates to 3 minutes.

//Somewhere else in your script (OUTSIDE of a callback) -

forward ShowARandomMessage();
public ShowARandomMessage()
{
    new
        RandomSelection = random(3); //Randoms start from 0 and work their way up -- THEY DO NOT START AT 1.

    switch(RandomSelection) {
        case 0: {
            return SendClientMessageToAll(0xE8B210FF, RANDOM_MESSAGE1);
        }
        case 1: {
            return SendClientMessageToAll(0xE8B210FF, RANDOM_MESSAGE2);
        }
        case 2: {
            return SendClientMessageToAll(0xE8B210FF, RANDOM_MESSAGE3);
        }
    }
    return 1;
}
Like I said above, I don't mean to hijack your thread, I just felt the need to share how I personally do it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)