Class Selection screen
#1

Hi, Im a noob scripter, and I just joined to the world of PAWN yesterday, I although did try scripting a few months ago, No luck.
I now understand the language of PAWN and C++ and all that, and I can run a server and test it, it's just that I have one problem:
I have NO IDEA how to script a class selection screen with dancing characters, meant to show how they look and have an announcement (player-side only) telling the player what the class's name is, where it spawns (textdraw, perhaps?) and what weapons it has.

Please help!
Reply
#2

If you started yesterday, I dont think you fully understand pawn now.

To do the things you asked for, you have to work with samp's callback structure. Callbacks are called, if something specific happens in the game or on the server, like when a player connects, when a player dies, when someone mods a vehicle,... There are callbacks for lots of events, you can see them all on this page: https://sampwiki.blast.hk/wiki/Scripting_Callbacks
(The samp wiki will become one of your best virtual friends when you keep on learning to script. Always search in it, before asking here in the forum, or perople will just send you a link to the wiki, that is answering your question)

The callback that you need is OnPlayerRequestClass (https://sampwiki.blast.hk/wiki/OnPlayerRequestClass)
It is called when a player is at class selection, and changes the class with the arrow buttons.
It is probably already in your script, so search for it, you can just add things you like.

To make a player dance, take a look at this: https://sampwiki.blast.hk/wiki/SetPlayerSpecialAction
Just add it somewhere in the callback.
To show something, you will have to use textdraws (hard for beginners) or gametexts (I recommend you using them at first, https://sampwiki.blast.hk/wiki/GameTextForPlayer)


So, have fun experimenting with it
Reply
#3

Callbacks are not specific to SA:MP - hence the ability to be able to create your own. They are also featured in other languages, also supporting them not being specific to SA:MP. I just want to make sure you don't mess those two concepts up, Mauzen. Same goes for functions, variables, etc.

Ilan321: You have to take the time to study the functions and callbacks that are available with SA:MP's libraries. These can all be found on the SA:MP Wiki. Take your time to look at ApplyAnimation function and OnPlayerRequestClass callback.

The most difficult thing with starting a new language is understanding what you can do with it. With more limitations, like SA:MP, it makes it that much more difficult. Look through all the functions and callbacks to get an idea of what is possible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)