SA-MP Forums Archive
Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - 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: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. (/showthread.php?tid=408989)



Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

So I have a little question I use y_groups
I want to make same effect like here:

PHP код:
    if(classid == 0)
    {
        
gTeam[playerid] = BALLAS;
        
GameTextForPlayer(playerid,"~w~Ballas",3000,5); // This will show up an Text , when you select your class
        
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
        
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
        
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
        
SetPlayerFacingAngle(playerid,122.4500);
        
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
    
}
    else if(
classid == 1)
    {
        
gTeam[playerid] = GROVES;
        
GameTextForPlayer(playerid,"~w~Grove Street Famlilys",3000,5);
        
SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
        
SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
        
SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
        
SetPlayerFacingAngle(playerid,252.4717);
        
SetPlayerColor(playerid,0x55FF00FF);
    }

How it can be done? All code working like a charm only this is my question.


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - LarzI - 20.01.2013

Why not simply read the introduction/documentation on it in the thread?

https://sampforum.blast.hk/showthread.php?tid=194480


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

Did. and it helped just now the question is. If this will work as normally?
Quote:
if(classid == 0)
{
Group_SetPlayer(gParamedics, playerid, true);
GameTextForPlayer(playerid,"~w~Ballas",3000,5); // This will show up an Text , when you select your class
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
SetPlayerFacingAngle(playerid,122.4500);
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
}

Took some time to get in the code. Now I'am getting something.. Learning is the best way how to keep up the knowledge.


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

So okay.. I putted everything like that but still he sees only one gang... I don't know why!
Here is my code..

Quote:

if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
{
Group_SetPlayer(gCrips, playerid, true);
GameTextForPlayer(playerid,"~w~Crips",3000,5); // This will show up an Text , when you select your class
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
SetPlayerFacingAngle(playerid,122.4500);
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
}
else if(classid == 4 || classid == 5 || classid == 6 || classid == 7)
{
Group_SetPlayer(gSBF, playerid, true);
GameTextForPlayer(playerid,"~w~The Seville Boulevard Crips",3000,5); // This will show up an Text , when you select your class
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
SetPlayerFacingAngle(playerid,122.4500);
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
}




Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - LarzI - 20.01.2013

Hmm, not really, no.

I would recommend storing classid in a global variable, then on spawn (OnPlayerSpawn) set the group out from what classid he chose.

On top:
pawn Код:
new g_pClassID[ MAX_PLAYERS ];
OnPlayerRequestClass:
pawn Код:
g_pClassID[ playerid ] = classid;
OnPlayerSpawn:
pawn Код:
if( g_pClassID[ playerid ] == 1 )
{
    Group_SetPlayer( Group1, playerid, true );
}
else if( g_pClassID[ playerid ] == 2 )
{
    Group_SetPlayer( Group2, playerid, true );
}
Something like that.


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
g_pClassID[playerid] = classid;
    if(
g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == 3)
    {
        
GameTextForPlayer(playerid,"~w~Crips",3000,5); // This will show up an Text , when you select your class
        
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
        
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
        
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
        
SetPlayerFacingAngle(playerid,122.4500);
        
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
    
}
    else if(
g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == 7)
    {
        
GameTextForPlayer(playerid,"~w~The Seville Boulevard Crips",3000,5); // This will show up an Text , when you select your class
        
SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
        
SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
        
SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
        
SetPlayerFacingAngle(playerid,122.4500);
        
SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
    

Now he sees only one skin.... I don't know why.. Did that what you said on player spawn


PHP код:
public OnPlayerSpawn(playerid)
{
    if(
g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == 3)
    {
        
Group_SetPlayer(gCripsplayeridtrue);
    }
    else if(
g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == || g_pClassID[playerid] == 7)
    {
        
Group_SetPlayer(gSBFplayeridtrue);
    } 
The problem is I have multiple cameras with multiple spawn points... Just I don't get how to get them work!


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

Yeah.. Just I still try to figure that out.. why I can see only 1st group.. Not all of them.. Red your post multiple times and still trying to do my best. Thanks for advice. I will try to get it to work


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

I know 24 h didn't pass but.. I cant figure out.. How to do it


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - LarzI - 20.01.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Given that you're doing this in OnPlayerRequestClass, don't forget to remove them from that group again when they change skin - otherwise they will just stay in that group indefinately.
Which is why I suggested storing the classid in a variable and set the group after selection (OnPlayerSpawn). Not sure how that would work out, though, as I've never used y_groups before.


Re: Hello need help with y_groups... Never worked with it.. Thats why I'am asking. - Scrillex - 20.01.2013

"Group_SetPlayer(groupBallas, playerid, false);" I know that.. But the thing is OnPlayerRequest I cant select more groups only the first one.. I need to see all groupes.. So the thing is I cant even imagine how to do it...