SA-MP Forums Archive
Not all players, just one - 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: Not all players, just one (/showthread.php?tid=424740)



Not all players, just one - arjanforgames - 23.03.2013

How can I let this show for only ONE player.

pawn Код:
forward Map1Loaded();
public Map1Loaded()
{
    for( new i = 0; i < MAX_PLAYERS; i ++ )
    {
        TextDrawHideForPlayer(i, LoadingMap1);
        TextDrawHideForPlayer(i, Map1Name);
        TextDrawHideForPlayer(i, StripesMap1);
        ShowPlayerDialog(i, DIALOG_TEAMSELECT, DIALOG_STYLE_LIST, "Choose your team", "Spetsnaz\nBlack Ops", "Choose", "");
        SetPlayerPos(i, 1565.1692, -3558.5388, 52.3151);
        SetCameraBehindPlayer(i);
        TogglePlayerControllable(i, 1);
       
    }
}


This is what calls the Map1Loaded:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if( newkeys & KEY_YES )
    {
        ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
    }
    return 1;
}
Then if they choose Team Deathmatch:

pawn Код:
if(response)
    {
    switch(dialogid)
        {
            case DIALOG_CHOOSEGAME:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        TogglePlayerControllable(playerid, 0);
                        SetPlayerCameraPos(playerid, 1471.0837, -3464.1860, 61.6439);
                        SetPlayerCameraLookAt(playerid, 1576.0729, -3625.4319, 3.4897);
                        TextDrawShowForPlayer(playerid, LoadingMap1);
                        TextDrawShowForPlayer(playerid, Map1Name);
                        TextDrawShowForPlayer(playerid, StripesMap1);
                        SetTimer("Map1Loaded", 7000, 0);
                    }
                    case 1:
                    {
                        ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
                    }
                    case 2:
                    {
                        ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
                    }
                    case 3:
                    {
                        SetPlayerPos(playerid, 2009.4140, 1017.8990, 994.4680);
                    }
                }
            }
        }
    }

But at the end if the player gets the dialog of choosing his team other players get it also.
How to fix this?


Re: Not all players, just one - erminpr0 - 23.03.2013

pawn Код:
forward Map1Loaded(playerid);
public Map1Loaded(playerid)
{
        TextDrawHideForPlayer(playerid, LoadingMap1);
        TextDrawHideForPlayer(playerid, Map1Name);
        TextDrawHideForPlayer(playerid, StripesMap1);
        ShowPlayerDialog(playerid, DIALOG_TEAMSELECT, DIALOG_STYLE_LIST, "Choose your team", "Spetsnaz\nBlack Ops", "Choose", "");
        SetPlayerPos(playerid, 1565.1692, -3558.5388, 52.3151);
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid, 1);
}



Re: Not all players, just one - Misiur - 23.03.2013

pawn Код:
SetTimer("Map1Loaded", 7000, 0);
//to
SetTimerEx("Map1Loaded", 7000, 0, "i", playerid);
pawn Код:
forward Map1Loaded(playerid);
            public Map1Loaded(playerid)
            {
                TextDrawHideForPlayer(playerid, LoadingMap1);
                TextDrawHideForPlayer(playerid, Map1Name);
                TextDrawHideForPlayer(playerid, StripesMap1);
                ShowPlayerDialog(playerid, DIALOG_TEAMSELECT, DIALOG_STYLE_LIST, "Choose your team", "Spetsnaz\nBlack Ops", "Choose", "");
                SetPlayerPos(playerid, 1565.1692, -3558.5388, 52.3151);
                SetCameraBehindPlayer(playerid);
                TogglePlayerControllable(playerid, 1);
            }}



Re: Not all players, just one - arjanforgames - 23.03.2013

Testing..

EDIT: Omg.. Works again. Thank you so much.
Want to add me on skype? arjanforgames

EDIT 2: Ermin yours didn't :/ sry.