SA-MP Forums Archive
CallLocalFunction or RequestClass bug? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CallLocalFunction or RequestClass bug? (/showthread.php?tid=189532)



CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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


Re: CallLocalFunction or RequestClass bug? - TheXIII - 12.11.2010

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?


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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?


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

Then what should I do for it to work?


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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.


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

None of them worked


Re: CallLocalFunction or RequestClass bug? - Luka P. - 12.11.2010

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.


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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]


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

What code do you need?


Re: CallLocalFunction or RequestClass bug? - Luka P. - 12.11.2010

Post your OnPlayerRequestSpawn callback


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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;
}



Re: CallLocalFunction or RequestClass bug? - Luka P. - 12.11.2010

I don't see anything wrong there


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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.


Re: CallLocalFunction or RequestClass bug? - Luka P. - 12.11.2010

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


Re: CallLocalFunction or RequestClass bug? - The_Moddler - 12.11.2010

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.


Re: CallLocalFunction or RequestClass bug? - 0ne - 12.11.2010

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.


Re: CallLocalFunction or RequestClass bug? - The_Moddler - 12.11.2010

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


Re: CallLocalFunction or RequestClass bug? - 0ne - 13.11.2010

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


Re: CallLocalFunction or RequestClass bug? - gesior7 - 14.11.2010

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?


Re: CallLocalFunction or RequestClass bug? - 0ne - 18.11.2010

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!