How can i do this? (random word in the connect message)
#2

pawn Код:
new RandomMSG[][] =
{
    "You majesty %s has connected!",
    "Welcome king or queen, %s!",
    "The master has connected. Say hi to %s."
};

public OnPlayerConnect(playerid)
{
    new randMSG = random(sizeof(RandomMSG)); //calculates the size of RandomMSG (which is 3)
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string,sizeof(string),"%s",pName,playerid);
    SendClientMessageToAll(0x33CCFFAA, RandomMSG[randMSG]);    // Replace the color with your defined color.
    return 1;
}
Try this I guess...
Reply


Messages In This Thread
How can i do this? (random word in the connect message) - by chaosnz - 08.04.2011, 00:08
Re: How can i do this? (random word in the connect message) - by grand.Theft.Otto - 08.04.2011, 02:25

Forum Jump:


Users browsing this thread: 1 Guest(s)