SA-MP Forums Archive
i was wondering if i could get some help with this - 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: i was wondering if i could get some help with this (/showthread.php?tid=195964)



[HELP]checking if player is on a team - fangoth1 - 04.12.2010

this is a script for my DM server having trouble Checking if the player is already on a team
pawn Код:
public OnPlayerSpawn(playerid)
    {
    new money = GetPlayerMoney(playerid);
    ResetPlayerWeapons(playerid);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money);
   
    SetPlayerPos(playerid, 1283.73937988,64.11292267,1866.44262695);
    SetPlayerTeam(playerid, 3);
    SetPlayerColor(playerid, COLOR_WHITE);

    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);
    new money = GetPlayerMoney(playerid);
    {
    if teamid = team1
    SetSpawnInfo(playerid, 1, skinid, 1351.2615966797, 348.85372924805, 19.296350479126, 0, 22, 150, 0, 0, 0, 0);
    }
    }
    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;
    }



Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

Bump!!!!


Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

bump!!!!


Re: i was wondering if i could get some help with this - WillyP - 04.12.2010

Stop bumping every hour. You're not special.


Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

if i dont bump , it will get lost, and not seen, meaning no Assistance and i dont think im specail, instead of people like you putting other people Down


Re: i was wondering if i could get some help with this - rjjj - 04.12.2010

I did it

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);
    SetPlayerPos(playerid, 1283.73937988,64.11292267,1866.44262695);
    SetPlayerTeam(playerid, 3);
    SetPlayerColor(playerid, COLOR_WHITE);
    if(teamid == team1)
    {
        SetSpawnInfo(playerid, 1, skinid, 1351.2615966797, 348.85372924805, 19.296350479126, 0, 22, 150, 0, 0, 0, 0);
    }
    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;
}

I hope i have helped


Re: i was wondering if i could get some help with this - Ash. - 04.12.2010

Wait, surely theres no point in checking to see what team someones in, because if you set a players team, it removes them from the other team anyway?

Sorry ive probably missed the point, i just proof read your code...


Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

Well, i just testing in game, it still brings up the Dialog when you die but it does spawn you at the right spot , Nice work just gotta figure out out to make dialog go away now heeh


Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

well i got it
removed the return 1; on the dialog, fixed it so dialog doesnt show when you respawn thank rjjjj


Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

i Discovered 1 more problem im unsure how to fixm only on blue team it shows up, thats team2
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);
        }
        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;
    }



Re: i was wondering if i could get some help with this - fangoth1 - 04.12.2010

got anymore ideas im stumped again just for the blue team


Re: i was wondering if i could get some help with this - fangoth1 - 05.12.2010

bump!!!!!!!
Quote:
Originally Posted by fangoth1
Посмотреть сообщение
i Discovered 1 more problem im unsure how to fixm only on blue team it shows up, thats team2
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);
        }
        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;
    }