SA-MP Forums Archive
Team Balance F4 Detector - 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 Balance F4 Detector (/showthread.php?tid=322683)



Team Balance F4 Detector - SpiderWalk - 03.03.2012

Hello,I got problem when player Press F4 Team Balance is not working.And i dont know how to fix it.I hear it need detector but i dont know how to create it.If someone know please post here.


Re: Team Balance F4 Detector - T0pAz - 03.03.2012

What code are you having on OnPlayerRequestClass?

Edit: Try this. Not tested though.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(GetPVarInt(playerid, "hasrequested")) return 0;
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    SetPVarInt(playerid, "hasrequested", 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid, "hasrequested", 0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SetPVarInt(playerid, "hasrequested", 0);
    return 1;
}



Re: Team Balance F4 Detector - SpiderWalk - 03.03.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1644.4078,-1133.8214,58.2172);
    SetPlayerCameraPos(playerid, 1647.6301,-1134.5725,58.2489);
    SetPlayerCameraLookAt(playerid, 1644.4078,-1133.8214,58.2172);
    SetPlayerFacingAngle(playerid,258.5584);
    SetPlayerTeam(playerid,0);
    if(classid == 0)
    {
        GameTextForPlayer(playerid, "~r~Terrorist", 1500, 3);
    }
    else if(classid == 1)
    {
        GameTextForPlayer(playerid, "~b~S.W.A.T", 1500, 3);
    }
    if(GetPVarInt(playerid, "hasrequested")) return 0;
    return 1;
}
This i used your suggest but not tested


Re: Team Balance F4 Detector - T0pAz - 03.03.2012

Quote:
Originally Posted by SpiderWalk
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1644.4078,-1133.8214,58.2172);
    SetPlayerCameraPos(playerid, 1647.6301,-1134.5725,58.2489);
    SetPlayerCameraLookAt(playerid, 1644.4078,-1133.8214,58.2172);
    SetPlayerFacingAngle(playerid,258.5584);
    SetPlayerTeam(playerid,0);
    if(classid == 0)
    {
        GameTextForPlayer(playerid, "~r~Terrorist", 1500, 3);
    }
    else if(classid == 1)
    {
        GameTextForPlayer(playerid, "~b~S.W.A.T", 1500, 3);
    }
    if(GetPVarInt(playerid, "hasrequested")) return 0;
    return 1;
}
This i used your suggest but not tested
Do that for all of the callback and put it on the top and tell me what's the next problem you are having(I am sure you will have).


Re: Team Balance F4 Detector - SpiderWalk - 03.03.2012

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Do that for all of the callback and put it on the top and tell me what's the next problem you are having(I am sure you will have).
You mean that Vars?But problem is in that i have Map Changer which is based on Request Class i mean when map change server is not restarting but its force Request class.


Re: Team Balance F4 Detector - T0pAz - 03.03.2012

Quote:
Originally Posted by SpiderWalk
Посмотреть сообщение
You mean that Vars?But problem is in that i have Map Changer which is based on Request Class i mean when map change server is not restarting but its force Request class.
Hmmm that's a problem. I think you have to make a custom class selection.


Re: Team Balance F4 Detector - SpiderWalk - 03.03.2012

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Hmmm that's a problem. I think you have to make a custom class selection.
aha.Huh....