Need help
#1

hello i need help with something i want to say hello in game while i saye hello i want to make the person move his hands like in the anim plz help and sorry for bad language
Reply
#2

Very simple to do.

First, let's make some worlds, what will be used for this "hand waving"

pawn Код:
new WaveTexts[][3] = { "Hello", "Hi", "Wazap" }; // [3] means, that there are 3 words only. You can add your own ones..
Now, lets make command, what will detect if player says that:

pawn Код:
public OnPlayerText(playerid, text[])
{
        for(new Order = 0; Order < sizeof(WaveTexts); Order++) // Will search if player (playerid) write one of WaveTexts's text
        {
            if(strfind(text, WaveTexts[Order], true) != -1)
            {
                ApplyPlayerAnimation(playerid, ...)
                    ApplyPlayerAnimation(playerid, ...)// Sorry, but forget the code for wave animation. Hope you'll find it out for yourself :) PS. Duplicate this function, to be sure that it will works!
                return 1;
            }
        }
}
Wua-la.
Reply
#3

i dont want hand waving i want the anim talking anim while the person talks the anim starts
Reply
#4

Aaah. So the player have to do TALK ANIM while send ANYTHING?
Well.

Let's try.

pawn Код:
OnPlayerText(playerid, text[])
{
if(IsPlayerConnected(playerid)) // Checks if playerid is connected
{
ApplyPlayerAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1);
return 1;
}
return 1;
}
So, while player write ANYTHING on the chat, he will start animation.
PS. I ain't tested it, you've to test it for yourself, and post any warnings/errors/complications.

~LetsOWN
Reply
#5

1 error and 2 warninigs


error 017: undefined symbol "ApplyPlayerAnimation"
warning 225: unreachable code
warning 217: loose indentation

do i have to put it like this under Onplayertext
like this


public OnPlayerText(playerid, text[])
{
OnPlayerText(playerid, text[])
{
if(IsPlayerConnected(playerid)) // Checks if playerid is connected
{
ApplyPlayerAnimation(playerid,"PED","IDLE_CHAT",4. 0,1,0,0,1,1);return 1;
}
return 1;
}
Reply
#6

Yes, you should.

1. Error? Well, I don't know your script, so i can only help you in this way:
pawn Код:
OnPlayerText(playerid, text[])
{
if(IsPlayerConnected(playerid)) // Checks if playerid is connected
{
// action what have to be done while player write something..
// try return 1; or without and check, if the warning 225 is appear.

}
return 1;
To avoid error and one warning.

To remove (completley) loose indentation error, on top of your script (below #define <a_samp>), add this smart function
pawn Код:
#pragma tabsize 0
~LetsOWN
Reply
#7

still 1 error i put whet you told me
Reply
#8

Hm, then try this:

pawn Код:
public OnPlayerText(playerid, text[]){
// Action (without anything, place it just after public)
// below should be rest of the code (if exist)
return 1;
}
Show me your code, please.

~LetsOWN
Reply
#9

what is that


error 017: undefined symbol "ApplyPlayerAnimation"
Reply
#10

Loool, it should not return any error..
And in the code there isn't any mistake..

Try:
pawn Код:
public OnPlayerText(playerid, text[]){
ApplyPlayerAnimation(playerid,"PED","IDLE_CHAT",4. 0,1,0,0,1,1);
return 1;
}
if it DOESN'T work then download latest includes from www.sa-mp.com (download section). If even THEN it wont work, then.. I don't know (-.-)
~Lets
Reply
#11

You moron.
pawn Код:
//Of course an undefined, it doesn't exist.. -.-"
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
Are you sure you have read the Wiki?
Reply
#12

Actually yes, but with my plugings, using auto-complete mode, I use ApplyPlayerAnimation.

And don't call me moron
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)