SA-MP Forums Archive
Need help setting up teams - 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 help setting up teams (/showthread.php?tid=358884)



Need help setting up teams - _Khaled_ - 12.07.2012

is that right?
Quote:

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,944.99,-41.64,1001.77);
SetPlayerFacingAngle(playerid,180.0);
SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
if(gTeam[playerid] == TEAM_CIVIL);
{
AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerTeamFromClass(playerid, classid);
GameTextForPlayer(playerid,"~w~CIVILIAN",1000,4);
}
if(gTeam[playerid] == TEAM_COP)
{
AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetPlayerTeamFromClass(playerid, classid);
GameTextForPlayer(playerid,"~b~COP",1000,4);
}
return 1;
}

Error while compiling:
Quote:

D:\SAMP\Server\gamemodes\SERVER.pwn(55) : warning 217: loose indentation
D:\SAMP\Server\gamemodes\SERVER.pwn(55) : error 036: empty statement
D:\SAMP\Server\gamemodes\SERVER.pwn(56) : warning 217: loose indentation
D:\SAMP\Server\gamemodes\SERVER.pwn(61) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: Need help setting up teams - CmZxC - 12.07.2012

No, you need to check them using classid.


Re: Need help setting up teams - _Khaled_ - 12.07.2012

Same error


Re: Need help setting up teams - CmZxC - 12.07.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid,944.99,-41.64,1001.77);
    SetPlayerFacingAngle(playerid,180.0);
    SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
    SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
    if(classid == 0)
    {
        // MOVE ADDPLAYERCLASS TO ONGAMEMODEINIT
        //AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
        SetPlayerTeamFromClass(playerid, classid);
        GameTextForPlayer(playerid,"~w~CIVILIAN",1000,4);
    }
    if(classid == 1)
    {
        //AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
        SetPlayerTeamFromClass(playerid, classid);
        GameTextForPlayer(playerid,"~b~COP",1000,4);
    }
    return 1;
}
pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
}



Re: Need help setting up teams - Miqueias Barros - 12.07.2012

exist two callbacks OnPlayerRequestClass, search your GM.


Re: Need help setting up teams - _Khaled_ - 12.07.2012

They're already there, no compiling error..
pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Cops and Criminals");
    AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(267, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
//==============================================================================
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid,944.99,-41.64,1001.77);
    SetPlayerFacingAngle(playerid,180.0);
    SetPlayerCameraPos(playerid,944.69,-47.54,1001.12);
    SetPlayerCameraLookAt(playerid,944.99,-41.64,1001.77);
    if(classid == 0)
    {
        SetPlayerTeamFromClass(playerid, classid);
        GameTextForPlayer(playerid,"~w~CIVILIAN",1000,4);
    }
    if(classid == 1)
    {
        SetPlayerTeamFromClass(playerid, classid);
        GameTextForPlayer(playerid,"~b~COP",1000,4);
    }
    return 1;
}
But when I join
It doesn't get me to the Axis I put to choose skins from


Re: Need help setting up teams - Captain_Mani - 12.07.2012

I think your Facing angle is incorrect to your Player Pos.
Recheck it from the savedpositions.txt file.