CallLocalFunction or RequestClass bug?
#1

pawn Код:
CallLocalFunction("OnPlayerRequestClass","d",playerid);
i Return 0; if the player didn't pass textdraws and after they pass i put that command to call the function, i try to press spawn while i didn't choose any character, wanted to spawn with CJ and when i press spawn nothing happens, but when i roll to other character i can spawn, I can roll back again and spawn with CJ, hard to explain the problem but RequestSpawn has nothing to do with this, it doesn't play music which i put on requestclass while I don't start to choose some else character
Reply
#2

I don't really understand what you're trying to do, but why would you call a native callback like that? Also OnPlayerRequestClass also has a 'classid' parameter.

Maybe a bit more code would help?
Reply
#3

I'm just trying to figure out the problem: After i call the function like that it doesn't allow me to spawn until i start to choose some other character, get it?
Reply
#4

Then what should I do for it to work?
Reply
#5

It starts to move persons camera when person joins the server and starts to show some textdraws with timers, after textdraws are shown i want the person to be in the requestclass screen and be available to choose the skin he is now looking at. I really don't know how to explain this but he just can't spawn unless he starts to select skins, the position,camera is fine.
Reply
#6

None of them worked
Reply
#7

Delete all your code you've done so far (regarding this thing, ofcourse), except the camera movement/rotation thing. After the script is done with rotating the player camera / animating textdraw, set the PVar "Done" to 1.

Then simply return the value of PVar "Done" in OnPlayerRequestSpawn callback. If the camera rotating is not done, player will be not able to spawn, and if it's done, player will be able to spawn.
Reply
#8

Nah that isn't my problem, here a video i made to u and ******

[ame]http://www.youtube.com/watch?v=Yf-S2O7r3_I[/ame]
Reply
#9

What code do you need?
Reply
#10

Post your OnPlayerRequestSpawn callback
Reply
#11

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
        GetPlayerName(playerid,sendername,24);
        #if defined LOGIN_BEFORE_SPAWN
        if(playerDB[playerid][Authed] == 0)
        {
            SendClientMessage(playerid,LIGHTBLUE,"[LOGIN] Account is registered, login in order to play.");
            return 0;
        }
        #endif
    #if defined REGISTER_BEFORE_SPAWN
        if (!udb_Exists(sendername))
        {
            SendClientMessage(playerid,LIGHTBLUE,"[LOGIN] Account is not registered,register in order to play.");
            return 0;
        }
    #endif
    if(GetPlayerSkin(playerid) == 188)
    {
        GameTextForPlayer(playerid, "~r~Enter the password", 3000, 3);
        IsRequestingSpawn[playerid] = 1;
        return 0;
    }
    return 1;
}
Reply
#12

I don't see anything wrong there
Reply
#13

Cause the requestspawn has nothing to do with it. I think I'm calling the function wrong or I have to add something more, I heard spectating works pretty good, tried to look at grandlarc gamemode 'nd did the same but i ended up with broken gm, i put him into spectate when he gets onrequestclass and then movecameras,showtextdraws etc. etc. but then as i try to untogglespectate him before the requestclass or in requestclass It works but I can't log in, I can't register, the functions doesn't work at all.
Reply
#14

See a definition of CALLBACK, it is not a function that will show the class selection screen.
Reply
#15

Try taking out this:

pawn Код:
if(GetPlayerSkin(playerid) == 188)
{
    GameTextForPlayer(playerid, "~r~Enter the password", 3000, 3);
    IsRequestingSpawn[playerid] = 1;
    return 0;
}
And if it's that, you should see another method of checking whatever you are checking there.
Reply
#16

Still didn't work, As i said it's not the requestspawn problem, It's requestclass because i think he doesn't get transfered to that callback.
Reply
#17

You don't have to call it manually, it get's called when you hit the button 'Spawn' in game.
Reply
#18

Did you see the video moddler? Cause it does nothing at all when i press Spawn, i need to reselect the skin.
Reply
#19

The video is deleted.
As Y_Less said, to put player on class selection skin, you must ForceClassSelection of that player and kill them or TogglePlayerSpectating to false ( 0 ).
If that doesn't resolve your problem, then what it is?
Reply
#20

gesior i tried that, and about spectating:

Quote:

but then as i try to untogglespectate him before the requestclass or in requestclass It works but I can't log in, I can't register, the functions doesn't work at all.

edit: SOLVED NO NEED HELP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)