Message modes
#1

If I do something like this would it give bugs or would it be wrong?

PHP код:
MessageModes(playerid)
{
    for(new 
0GetPlayerPoolSize(); <= ji++) 
    {
        if(
IsPlayerConnected(i))
        {
            switch(
Player[i][Mode])
            {
                case 
GAME_DM:
                {
                    
SendClientMessageEx(i, -1"DEATHMATCH: %s(%d) joined (players: %d/20)"Player[playerid][Name], playeridPlayers_DM);
                }
                case 
GAME_DERBY:
                {
                    
SendClientMessageEx(i, -1"DERBY:%s(%d) joined (players: %d/20)"Player[playerid][Name], playeridPlayers_Derby);
                }
                case 
GAME_MINIGUN:
                {
                    
SendClientMessageEx(i, -1"MINIGUN: %s(%d) joined (players: %d)"Player[playerid][Name], playeridPlayers_Minigun);
                }
                case 
GAME_ROCKET:
                {
                    
SendClientMessageEx(i, -1"ROCKET: %s(%d) joined (players: %d)"Player[playerid][Name], playeridPlayers_Rocket);
                }
            }
        }
    }
    return 
1;

Reply
#2

I dont see any mistake in this code, does it work fine with you?
Reply
#3

If it works well. But I mean that if I add many messages, it can be overloaded, give some lag / bug or something?
Reply
#4

No if your code is written properly and in the most efficient way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)