oscar-broman / PAWN-Boilerplate

(discontinued) Solid core for a big SA-MP server script.
http://sa-mp.com/
24 stars 13 forks source link

Classes not added until after language selection #28

Closed Jameskmonger closed 11 years ago

Jameskmonger commented 11 years ago

Until you select a language, the class on the request class screen is CJ, even if you don't have a CJ-skinned class. When you select a language, the classes are added, but it would be nice to have it so that the classes were initialised before the player is told to pick a language so that you don't see a class you can't spawn into :)

oscar-broman commented 11 years ago

I can't replicate this. Do you do anything special in OnPlayerRequestClass?

Jameskmonger commented 11 years ago
    ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,1,0,0,0,0,1); // Make the player dance for the select class screen

    new class = ClassSelection.RequestedClass[playerid]; // Declare the class variable (makes the if-elseif-else statement below shorter)
    new this.className[13]; // Declare the className variable that will be used below.

    if(ClassSelection.Classes[class][Group] == GROUP_CIVILIAN) this.className = "~w~Civilians"; // If a civilian, set the className string to "~w~Civilians"
    else if(ClassSelection.Classes[class][Group] == GROUP_POLICE) this.className = "~b~Police"; // If a police officer, set the className string to "~b~Police"
    else if(ClassSelection.Classes[class][Group] == GROUP_MEDIC) this.className = "~g~Medics"; // If a medics, set the className string to "~g~Medics"
    else this.className = " "; // If none of the above are true (something's wrong) then just set the class name to a space, effectively blank

    GameTextForPlayer(playerid, this.className, 1000, 4); // Show a second-long gametext to the player, containing the name of their "team" (group)

Is my whole OnPlayerRequestClass

oscar-broman commented 11 years ago

Does it work if you were to comment that out? I can't really see anything there that would mess things up.

Jameskmonger commented 11 years ago

This appears to have been fixed, I'll re-open it if it happens again