[FilterScript] Advanced system minigames
#9

Just some suggstions:


1.
pawn Code:
CMD:exit(playerid, params[])
{
    SpawnPlayer(playerid);
    ActualizarJuegos();
    EsHumano[playerid] = 0;
    EsZombie[playerid] = 0;
    Carnes[playerid] = 0;
    MediKits[playerid] = 0;
    Game[playerid][Zhomviez] = 0;
    Game[playerid][CSMap1] = 0;
    Game[playerid][CSMap2] = 0;
    Game[playerid][CSMap3] = 0;
    Game[playerid][CSMap4] = 0;
    Game[playerid][CSMap5] = 0;
    Game[playerid][CSMap6] = 0;
    Game[playerid][CSMap7] = 0;
    Game[playerid][CSMap8] = 0;
    Game[playerid][CSMap9] = 0;
    Game[playerid][CSMap10] = 0;
    Game[playerid][CSMap11] = 0;
    Game[playerid][MinigunDM] = 0;
    Game[playerid][Minigun2DM] = 0;
    Game[playerid][RocketDM] = 0;
    Game[playerid][RocketDM2] = 0;
    Game[playerid][ZonaWW] = 0;
    Game[playerid][ZonaRW] = 0;
    Game[playerid][Counter] = 0;
    return 1;
}

//...
CALLBACK: ActualizarJuegos()
{
    SetTimer("UsersCS", 1000, true);
    SetTimer("UsersCS11", 1000, true);
    SetTimer("UsersCS10", 1000, true);
    SetTimer("UsersCS9", 1000, true);
    SetTimer("UsersCS8", 1000, true);
    SetTimer("UsersCS7", 1000, true);
    SetTimer("UsersCS6", 1000, true);
    SetTimer("UsersCS5", 1000, true);
    SetTimer("UsersCS4", 1000, true);
    SetTimer("UsersCS3", 1000, true);
    SetTimer("UsersCS2", 1000, true);
    SetTimer("UsersCS1", 1000, true);
    SetTimer("UsersMinigun", 1000, true);
    SetTimer("UsersMinigun2", 1000, true);
    SetTimer("UsersRocket", 1000, true);
    SetTimer("UsersRocket2", 1000, true);
    SetTimer("UsersMDM", 1000, true);
    SetTimer("UsersZonaWW", 1000, true);
    SetTimer("UsersZonaRW", 1000, true);
    SetTimer("UsersZombieAttack", 1000, true);
    return 1;
}
That may over-load your server because it will be called often by players and will update these mini-games. You only need one timer, and use it for update all mini-games.

2. What Sreyas said.

3. What Sreyas said x2, or this:
pawn Code:
stock UsersCS6()
{
    new Gaim12;
    for(new i, g = GetMaxPlayers(); i < g; i++)
    {
    //if(IsPlayerConnected(i)) You doesn't check if it's connected, cause "CSMap6" can verify that in some way.
        if(Game[i][CSMap6] == 1)  Gaim12++;
    }
    return Gaim12;
}

3. Don't use "CALLBACK:" for callbacks that are pre-defined by SA-MP includes. Use "public" instead.

4. You have many arrays size problems.


But don't get mad! You will improve this in a future
It's a nice system, so keep it up
Reply


Messages In This Thread
Advanced system minigames - by BrianFaria - 21.11.2016, 13:15
Re: Advanced system minigames - by RyderX - 21.11.2016, 14:04
Respuesta: Advanced system minigames - by BrianFaria - 21.11.2016, 14:16
Re: Advanced system minigames - by Eoussama - 21.11.2016, 14:33
Re: Advanced system minigames - by EdgarHN - 21.11.2016, 16:16
Re: Advanced system minigames - by BrianFaria - 21.11.2016, 22:07
Re: Advanced system minigames - by SyS - 22.11.2016, 00:14
Respuesta: Advanced system minigames - by BrianFaria - 22.11.2016, 06:21
Respuesta: Advanced system minigames - by Swedky - 25.11.2016, 07:03
Re: Respuesta: Advanced system minigames - by Jelly23 - 25.11.2016, 14:21
Re: Respuesta: Advanced system minigames - by BrianFaria - 26.11.2016, 06:12
Re: Advanced system minigames - by Alpay0098 - 01.12.2016, 10:50
Re: Advanced system minigames - by BrianFaria - 01.12.2016, 12:32
Re: Advanced system minigames - by SeeD - 12.05.2018, 02:49

Forum Jump:


Users browsing this thread: 1 Guest(s)