Problem with SetPlayerTeamFromClass
#3

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
Class ID != skin ID.
https://sampwiki.blast.hk/wiki/OnPlayerRequestClass


So the first AddPlayerClass is class ID 0 and the second one is class ID 1, etc.
Hm, I think I know what you mean ... but isn`t there a way to 'shorten' it?

If I`m not wrong, you're trying to say next:

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
    case 0:gTeam[playerid] = TEAM_POLICE; // First AddPlayerClass in GameModeInit
    case 1:gTeam[playerid] = TEAM_POLICE;// Second AddPlayerClass in GameModeInit
    }
}
And if I`m right and that`s what you're trying to tell me, I have another question:

Let`s say I have 100 AddPlayerClass ... or how about if I have more than 1 skin per team? Can`t I somehow group them all together?

What I mean is next: Instead of "case 0: bla bla" to use "case 71,123,200, etc: bla bla" - 71,123,200, etc = Skins ID which I used.

Is there anyway of using Skins ID instead of Class ID? Or is it better, easier to use class ID ? If yes, how can I set it up using class ID ?


Later Edit: Okay, so I`ve played around my script, taking note of what you said and I think I somehow fixed the problem. Instead of using:
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
I used
pawn Код:
SetPlayerTeamFromClass(playerid, skinid)
and of course:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        new skinid = GetPlayerSkin(playerid);
I`ll give it few tests before I can surely tell you if it works or not ... I`ll come back with another later edit to tell you if it works.

Thank you for your help.

Later later edit:

Yes, I finally fixed it.

Thanks [03]Garsino for your help.
Reply


Messages In This Thread
Problem with SetPlayerTeamFromClass - by antonio112 - 05.02.2011, 23:29
Re: Problem with SetPlayerTeamFromClass - by [03]Garsino - 06.02.2011, 19:19
Re: Problem with SetPlayerTeamFromClass - by antonio112 - 06.02.2011, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)