OnPlayerRequestClass classid Only returning 3 skins?
#1

Hey guys,
this is driving me up the wall.

First off, under OnGameModeInt(...)

pawn Код:
for(new i=20; i<299; i++)
    {
        if(IsInvalidSkin(i)) continue;
       
        SkinIDs[i] = Class_Add(i, 0.0, 0.0, 4.0, 0.0, -1, -1, -1, -1); //Use SkinIDs[i] for use elsewhere
    }
OnPlayerRequestClass(playerid, classid)

pawn Код:
printf("%i", classid);
if(PlayersSkin != -1) Class_Goto(playerid, SkinIDs[PlayersSkin]);
else Class_Goto(playerid, classid);
When I try select a skin it only scrolls through 3 different skins and shows in console
Код:
0
1
2
0
1
2
0
1
2
Reply
#2

try that,
pawn Код:
for(new i=0; i<299; i++)
    {
    for(new i2 =0;i<299;i++)
{
        if(IsInvalidSkin(i)) continue;
       
        SkinIDs[i2] = Class_Add(i, 0.0, 0.0, 4.0, 0.0, -1, -1, -1, -1); //Use SkinIDs[i] for use elsewhere
    }
}
Reply
#3

I've got version 3.1 .

But when i try use OnPlayerRequestClassEx i got
Код:
 warning 235: public function lacks forward declaration (symbol "OnPlayerRequestClassEx")
so i used

pawn Код:
forward OnPlayerRequestClassEx(playerid, classid);
But then when it goes to class selection it only shows CJ and it only calls it once, and does not call it again even when using left and right keys

Currently I have (#include <YSI\y_classes>) at the bottom of my includes.
I dont use (#inclide <YSI>) becuase i get a whole bunch of errors that I have tried to search and fix but no luck.

Such as:
- I get a whole bunch of "Undefined Symbol "cmd_..." with only some, but most of my commands. (Using zcmd)
- warning 203: symbol is never used: "Langs_AddLanguage"
- warning 201: redefinition of constant/macro (symbol "CMD:%0(%1)")

I have tried disabling zcmd but get:
- a bunch of loose indentation (its all correct)
- Most but not all commands are "Undefined symbol"


When I was using the standard AddPlayerClass it was working fine, but that was when I was going to class selection after the player had logged in/registered.

I'm trying to get it so that the player logs in at the class selection screen, and if they are registered already shows the skin they have selected. hence why i'm trying to use Class_Add

EDIT:
I have included all of <YSI>.. what a nightmare, had to figure out the lang_add thing.. took me a while. Also converted all my commands to YCMD now working nicely.
Anyway, still doing the same thing but only warning i get now is " warning 235: public function lacks forward declaration (symbol "OnPlayerRequestClassEx")"



******, you should add something for double commands? example:
pawn Код:
YCMD:cmds(playerid, params[], help) return YCMD_commands(playerid, params[], help);
YCMD:commands(playerid, params[], help)
{
    //Commands
}
EDIT 2:
Tried the bete version of YSI (4.0) but get the following errors
Код:
...\pawno\include\YSI\..\YSI_Visual\y_classes/multiclass.inc(768) : error 017: undefined symbol "Player_InSelection"
...\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(229) : error 025: function heading differs from prototype
...\pawno\include\YSI\..\YSI_Storage\y_svar/ini.inc(114) : error 017: undefined symbol "INI_WriteArray"
...\pawno\include\YSI\..\YSI_Players\y_users/ini.inc(633) : error 017: undefined symbol "INI_WriteArray"
...\pawno\include\YSI\..\YSI_Players\y_users/ini.inc(628) : warning 203: symbol is never used: "len"
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
1) y_classes doesn't work in 4.0.
I figured after playing a little bit with your includes.
I have reverted to using YSI 3.1

Quote:
Originally Posted by ******
Посмотреть сообщение
2) Fair play on getting the whole of YSI included but I suspect you didn't need it.
Yeah, I thought I would try just in case some of the errors I was getting was caused by something that wasn't included.
I am no longer running all of YSI (See below)

Quote:
Originally Posted by ******
Посмотреть сообщение
3) "Command_AddAlt" for alternate names.
I havn't had time to try this yet, but had a quick search and I think using Command_AddAltNamed would make it easier as I don't know what any of the IDs would be.

Quote:
Originally Posted by ******
Посмотреть сообщение
4) I've had a look in the include, and I'm not actually sure why you are only getting three classes. I know where they come from, since y_classes uses three internally and translates them, but you should never see that. Have you tried moving the include up perhaps so it isn't last? Otherwise, I may need to see your mode (privately if you want).
Tried moving the include just below <fixes> still no luck.

I am no longer using all of YSI just y_commands. I am now using the code:

OnGameModeInt
pawn Код:
//AddPlayerClass
    for(new i=22; i<300; i++)
    {
        if(IsInvalidSkin(i)) continue;
        AddPlayerClass(i, 0.0, 0.0, 4.0, 0.0, -1, -1, -1, -1, -1, -1);
    }
OnPlayerRequestClass
pawn Код:
printf("%i, %i", Player[playerid][Skin], classid); // This outputs as it should.
if(Player[playerid][Skin] > -1) SetSpawnInfo( playerid, 0, Player[playerid][Skin], 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 ); //Class_Goto(playerid, SkinIDs[Player[playerid][Skin]]);
and at the end of OnPlayerConnect (After user data is loaded/not loaded) OnPlayerRequestClass(playerid, 0);

It is all working as it should and as I want.
I would like to use y_classes but cannot figure out what the problem is. I had a quick look through y_classes coudln't see anything obvious.

I also changed in y_classes (#define MAX_CLASSES (300)) to see if that was my problem as i found not all skins were being added and there were a lot of -1s being added to SkinIDs[]. once I changed it i tried again and still same thing.

I tried with 4 skins, but still cuts out the 4th skin.

I'll leave it how it is until I see an update for y_classes and then try again.

EDIT:
Are there still invalid skin ids? I read somewhere that there isnt.

Console output of the printf(..)
Код:
[13:30:53] -1, 3
[13:30:53] -1, 2
[13:30:53] -1, 1
[13:30:53] -1, 0
[13:30:54] -1, 242
[13:30:54] -1, 241
[13:30:54] -1, 240
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)