SA-MP Forums Archive
[Help]Cant figure this out - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help]Cant figure this out (/showthread.php?tid=196298)



[Help]Cant figure this out - fangoth1 - 05.12.2010

Need some help with this, The dialog only appears for blue team when they die, blue team is team2 and i dont want it to show if there on either team
pawn Код:
public OnPlayerSpawn(playerid)
    {
        new money = GetPlayerMoney(playerid);
        new skinid = GetPlayerSkin(playerid);
        new teamid = GetPlayerTeam(playerid);
        new team1 = SetSpawnInfo(playerid, 1, skinid, 1351.2615966797, 348.85372924805, 19.296350479126, 0, 22, 150, 0, 0, 0, 0);
        new team2 = SetSpawnInfo(playerid, 2, skinid, 83.93970489502, -149.35932922363, 2.2334928512573, 0, 22, 150, 0, 0, 0, 0);

        ResetPlayerWeapons(playerid);
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, money);
       
        if(teamid == team1)
        {
        SetSpawnInfo(playerid, 1, skinid, 1351.2615966797, 348.85372924805, 19.296350479126, 0, 22, 150, 0, 0, 0, 0);
        GivePlayerWeapon(playerid, 22, 150);
        }
        else
        {
        if(teamid == team2)
        {
        SetSpawnInfo(playerid, 2, skinid, 83.93970489502, -149.35932922363, 2.2334928512573, 0, 22, 150, 0, 0, 0, 0);
        }
        else
        {
        ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "CHOOSE YOUR TEAM", "Red Team----[The Assualting Team]\nBlue Team----[The Defensive Team]", "Chose", "Cancel");
        return 1;
        }
        }
        return 1;
    }



Re: [Help]Cant figure this out - dice7 - 05.12.2010

The above code should show the dialog only to players who don't have a team. Show your OnPlayerDeath


Re: [Help]Cant figure this out - fangoth1 - 05.12.2010

what do you mean? the show the dialog first then the teams?


Re: [Help]Cant figure this out - dice7 - 05.12.2010

Just show your OnPlayerDeath


Re: [Help]Cant figure this out - fangoth1 - 05.12.2010

ok i see
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
    {
    SendDeathMessage(killerid, playerid, reason);
   
    new tmp[128];

    new killer = strval(tmp);
   
    new killername[MAX_PLAYER_NAME];

    GetPlayerName(killer, killername, MAX_PLAYER_NAME);

    new score = GetPlayerScore(killer);
   
    GetPlayerMoney(killer);
    GivePlayerMoney(killer, 100);
    GetPlayerMoney(playerid);
    GivePlayerMoney(playerid, -50);
    GetPlayerScore(killer);
    SetPlayerScore(killer, score +1);
    return 1;
    }