SA-MP Forums Archive
Team ??? - 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: Team ??? (/showthread.php?tid=286273)



Team ??? - ChromeHD - 27.09.2011

where do i put


SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
}

in team script


Re: Team ??? - Dripac - 27.09.2011

OnPlayerSpawn


Re: Team ??? - sleepysnowflake - 27.09.2011

@Za guy above:

NO! You put only "SetPlayerToTeamColor(playerid)" under "OnPlayerSpawn".
The "SetPlayerToTeamColor(playerid)" you put between 2 public functions :3


Re: Team ??? - ChromeHD - 27.09.2011

public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
}
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
}


like that


Re: Team ??? - sleepysnowflake - 27.09.2011

pawn Код:
forward SetPlayerToTeamColor(playerid); // On the top.

// Between 2 public functions :

SetPlayerToTeamColor(playerid);
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
    return 1;
}

// OnPlayerSpawn

public OnPlayerSpawn(playerid)
{
        SetPlayerToTeamColor(playerid);
    return 1;
}
:3


Re: Team ??? - ChromeHD - 27.09.2011

wait dam i want to build a org like police


Re: Team ??? - ChromeHD - 27.09.2011

plus i get these errors

C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(83) : error 055: start of function body without function header
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(84) : error 010: invalid function or declaration
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(8 : error 010: invalid function or declaration
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(92) : error 010: invalid function or declaration
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(9 : error 004: function "SetPlayerToTeamColor" is not implemented
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(99) : warning 217: loose indentation
C:\Users\ChrissyH\Desktop\TEAM TEST.pwn(266) : warning 203: symbol is never used: "SetPlayerTeamFromClass"


Re: Team ??? - sleepysnowflake - 27.09.2011

Dude, you put the forward thingy ?


Re: Team ??? - Azzeto - 27.09.2011

This is from my script, if it will help you!
pawn Код:
//On gamemodeinit
AddPlayerClass(285,1545.8413,-1675.4119,13.5612,87.3719,0,0,0,0,0,0); // Police Spawn
//On playerrequestclass
else if(classid == 2)//3rd spawn option
    {
        gTeam[playerid] = TEAM_POLICE
        GameTextForPlayer(playerid,"~b~Los Santos Police",3000,5);
        SetPlayerPos(playerid,1545.8413,-1675.4119,13.5612);
        SetPlayerCameraPos(playerid,1534.0709,-1675.0957,13.3828);
        SetPlayerCameraLookAt(playerid,1545.8413,-1675.4119,13.5612);
        SetPlayerFacingAngle(playerid,88.9386);
        SetPlayerColor(playerid,COLOR_BLUE);
        SetPlayerTeam(playerid,2);
    }
If this will help at all?


Re: Team ??? - Kush - 27.09.2011

Quote:
Originally Posted by Berlovan
Посмотреть сообщение
pawn Код:
forward SetPlayerToTeamColor(playerid); // On the top.

// Between 2 public functions :

SetPlayerToTeamColor(playerid);
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
    return 1;
}

// OnPlayerSpawn

public OnPlayerSpawn(playerid)
{
        SetPlayerToTeamColor(playerid);
    return 1;
}
:3
There is no need to call a function within another function! Especially when the arguments are only valid to the player.