Class selection bug
#1

Hey Guys,

I use the ysi_class include from YSI, wich works for me and for the script everything works fine so i can choose a team (city) and then i go to onplayerrequestclass but the thing is that i have 2 teams

Код:
    Class_AddForGroup(gRepublicans, 284, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gRepublicans, 287, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gRepublicans, 285, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gRepublicans, 274, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gRepublicans, 277, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    
    Class_AddForGroup(gLiberators, 73, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gLiberators, 179, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gLiberators, 206, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gLiberators, 143, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
    Class_AddForGroup(gLiberators, 27, 1958.3783, 1343.1572, 15.3746, 0.0, 0);
And when i choose team Liberators my first skin (in the class selection menu is 284 wich belongs to the other team)
and when i press the arrow key to left or the right this class dissapears now i need to find a way to skip the 284 class so i see my own team skins.
Код:
public OnPlayerRequestClass(playerid, classid) {
    if(playersInfo[playerid][pFaction] == 0) {
	   	PlayerFactionSelected[playerid] = -1;
		PlayerFactionSelection[playerid] = 0;
		PlayerFirstScreen[playerid] = 1;
		PlayerFactionSelectedtick[playerid] = GetTickCount();
		TogglePlayerSpectating(playerid, 1);
    	TextDrawShowForPlayer(playerid, txtClassSelHelper);
		//playersInfo[playerid][pChoosedClass] = 0;
    	Class_FactionHandle(playerid);
    	Class_SetupSelectedFaction(playerid);
    	playersInfo[playerid][pStatus] = PLAYER_STATUS_LOGGED_IN;
	} else {
		if(playersInfo[playerid][pFaction] == 1) {
            Group_SetPlayer(gLiberators, playerid, true);
            Group_SetPlayer(gRepublicans, playerid, false);
            Class_SetPlayer(218, playerid, false);
		} else if(playersInfo[playerid][pFaction] == 2) {
			Group_SetPlayer(gRepublicans, playerid, true);
		    Group_SetPlayer(gLiberators, playerid, false);
		    Class_SetPlayer(217, playerid, false);
		}
		TogglePlayerSpectating(playerid, 0);
		SelectSkin(playerid, classid);
        playersInfo[playerid][pChoosedClass] = 1;
	}
	return 1;
}

forward SelectSkin(playerid, classid);
public SelectSkin(playerid, classid) {
    Class_HideAllTextDraws(playerid);
	SetPlayerPos(playerid, 1984.4445,157.9501,55.9384);
    SetPlayerCameraPos(playerid, 1984.4445,160.9501,55.9384);
	SetPlayerCameraLookAt(playerid, 1984.4445,157.9501,55.9384);
	SetPlayerFacingAngle(playerid, 0.0);
	playersInfo[playerid][pChoosedClass] = 1;
	playersInfo[playerid][pSkin] = classid;
 	Class_Goto(playerid, classid);
	return 1;
}
Anyone know any solution for this? Thanks in advance!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)