Need help -
Dan_Barocu - 20.05.2011
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
Re: Need help -
LetsOWN[PL] - 20.05.2011
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.
Re: Need help -
Dan_Barocu - 20.05.2011
i dont want hand waving i want the anim talking anim while the person talks the anim starts
Re: Need help -
LetsOWN[PL] - 20.05.2011
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
Re: Need help -
Dan_Barocu - 20.05.2011
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;
}
Re: Need help -
LetsOWN[PL] - 20.05.2011
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
~LetsOWN
Re: Need help -
Dan_Barocu - 20.05.2011
still 1 error i put whet you told me
Re: Need help -
LetsOWN[PL] - 20.05.2011
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
Re: Need help -
Dan_Barocu - 20.05.2011
what is that
error 017: undefined symbol "ApplyPlayerAnimation"
Re: Need help -
LetsOWN[PL] - 20.05.2011
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
Re: Need help -
Seven_of_Nine - 20.05.2011
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?
Re: Need help -
LetsOWN[PL] - 20.05.2011
Actually yes, but with my plugings, using auto-complete mode, I use ApplyPlayerAnimation.
And don't call me moron