SA-MP Forums Archive
Need This Card [+rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need This Card [+rep] (/showthread.php?tid=324456)



Need This Card [+rep] - Champ - 09.03.2012

i saw a score card in a server that have gamemode changing system and i have also gamemode changing system but i need a score card like this. i saw in another server



when gm restarts it will gives the result of players..

thanks.



Re: Need This Card [+rep] - SpiritEvil - 09.03.2012

Before using "SendRconCommand("gmx")" Display a dialog that displays the player stats (stored in variables) using a loop.


Re: Need This Card [+rep] - Champ - 09.03.2012

please can you make the textdraw given above ?
i don't know gmx but i have this ↓

pawn Код:
public GameModeExitFunc(playerid) {
    SendRconCommand("changemode GM2");
    GameTextForAll("~y~Changing Game ~n~ ~w~Please Wait....",5000,1);
    for(new i;i<15;++i)
    {
        SendClientMessageToAll(COLOR_Soldiers,"  ");
    }
    KillTimer(GameTimer);
    TextDrawHideForPlayer(playerid,Textdraw0);
    TextDrawDestroy(text_Top5[0]);
    TextDrawDestroy(text_Top5[1]);

     }
make this textdraw in this script

thanks



Re: Need This Card [+rep] - Shabi RoxX - 09.03.2012

this is not the textdraw.. . . . It dialog in pic


Re: Need This Card [+rep] - Champ - 09.03.2012

oh sorry dialog... create it please in the script given above


Re: Need This Card [+rep] - titanak - 09.03.2012

have you ever tryed to do it yourself or searched it on forum ?


Re: Need This Card [+rep] - SpiritEvil - 09.03.2012

Here is an example:

pawn Код:
enum sInfo // create an enum to store the server's information
{
    mostKills,
    mostKillsPlayer[MAX_PLAYER_NAME],
    mostDeaths,
    mostDeathsPlayer[MAX_PLAYER_NAME],
};

new ServerInfo[sInfo];

enum pInfo // create an enum to store the player's information
{
    Kills,
    Deaths,
};

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        PlayerInfo[killerid][Kills]++; // increase the killerid's kills
        if(PlayerInfo[killerid][Kills] > ServerInfo[mostKills]) // check if the killerid's total kills are greater than the server's maxKills
        { // if they are proceed
            new pName[MAX_PLAYER_NAME]; //create a string to store the player's name
            ServerInfo[mostKills] = PlayerInfo[playerid][Kills]; //update the server's info with the new maxKills
            GetPlayerName(killerid, pName, MAX_PLAYER_NAME); //get the player's name
            ServerInfo[mostKillsPlayer] = pName; //store the player's name to the mostKillsPlayer variable
        }
    }

    //same thing with the deaths
    PlayerInfo[playerid][Deaths]++;
    if(PlayerInfo[playerid][Deaths] > ServerInfo[mostDeaths])
    {
        new pName[MAX_PLAYER_NAME];
        ServerInfo[mostDeaths] = PlayerInfo[playerid][Deaths];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        ServerInfo[mostDeathsPlayer] = pName;
    }
    return 1;
}

public GameModeExitFunc(playerid)
{
    GameTextForAll("~y~Changing Game ~n~ ~w~Please Wait....",5000,1);
    for(new i;i<15;++i)
    {
        SendClientMessageToAll(COLOR_Soldiers,"  ");
    }
    KillTimer(GameTimer);
    TextDrawHideForPlayer(playerid,Textdraw0);
    TextDrawDestroy(text_Top5[0]);
    TextDrawDestroy(text_Top5[1]);
    new str[200]; //create a string to format
    format(str, sizeof(str), "Most Kills: %i\nMost Kills Player: %s\nMost Deaths: %i\nMost Deaths Player: %s", ServerInfo[mostKills], ServerInfo[mostKillsPlayer], ServerInfo[mostDeaths], ServerInfo[mostDeathsPlayer])
    // ^ format the string with the information required
    for(new i = 0; i <= GetMaxPlayers(); i++) // loop through all connected players
    {
        if(IsPlayerConnected(i))
        {
            ShowPlayerDialog(i, 385, DIALOG_STYLE_LIST, "Match results", str, "Close" ""); //show the dialog to every connected player
        }
    }
    SendRconCommand("changemode GM2"); // change the game mode

}
I hope you understand it because it took me some time to finish


Re: Need This Card [+rep] - Champ - 10.03.2012

i think i will give some errors can you give me .pwn file by uploading on solidfiles ?


Re: Need This Card [+rep] - Champ - 10.03.2012

any one other please...
please post .pwn file



Re: Need This Card [+rep] - Shabi RoxX - 10.03.2012

I'll try... Check your Pm.