SetPlayerSpecialAction not working correct
#1

This is a reaction, of some posts on the (inoffical) german SA:MP forums.

It's about, thats SetPlayerSpecial Action is probaly not working correct.

SpecialAction 12 (SPECIAL_ACTION_SITTING)
SpecialAction 24 (SPECIAL_ACTION_CUFFED)
SpecialAction 25 (SPECIAL_ACTION_CARRY)

This actions are not working in 0.3x (R1(-2))

SpecialAction 24 worked fine in 0.3e.
Some posts confirmed, that SpecialAction 12 is not working in 0.3e, too.

I tried it on a blank Script only with this Command

pawn Код:
CMD->test(playerid)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"SpecialAction","0\n1\n2\n3\n4\n5\n6\n7\n8\n10\n11\n12\n13\n20\n21\n22\n23\n24\n25","Set","Back");
    return true;
}
and this in Dialogresponse
pawn Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            if(response)
            {
                SetPlayerSpecialAction(playerid, strval(inputtext));
                SendClientMessage(playerid,-1,inputtext);
                return true;
            }
        }
    }
    return true;
}
Reply
#2

No response?
Reply
#3

When using DIALOG_STYLE_LIST, the output is in variable listitem.

pawn Код:
SetPlayerSpecialAction(playerid, listitem);
Reply
#4

Quote:
Originally Posted by niCe
Посмотреть сообщение
When using DIALOG_STYLE_LIST, the output is in variable listitem.

pawn Код:
SetPlayerSpecialAction(playerid, listitem);
Inputtext is also involved and passed to the callback. His code is correct I think, but I don't understand how it doesn't work.
Reply
#5

Code is wrong.
Inputtext is empty. Listitem only must be used.
Look:
Код:
text  listitem
0   0
1   1
2   2
3   3
4   4
5   5
6   6
7   7
8   8
10  9
11   10
12   11
13   12
20   13
21   14
22   15
23   16
24   17
25   18
Create array with number and get elements through listitem.

PHP код:
new actions[] = {0,1,2,3,4,5,6,7,8,10,11,12,13,20,21,22,23,24,25};
//
SetPlayerSpecialAction(playeridactions[listitem]); 
And inputtext only avaliable in DIALOG_STYLE_INPUT and DIAlOG_STYLE_PASSWORD
Reply
#6

He's not even using listitem. Look at his code!

'inputtext' holds the text in the dialog list for that listitem. He's using strval to get the ID. It should work fine.

Try making a command instead, in case this dialog IS the problem.
Reply
#7

I'm pretty sure inputtext works for lists, otherwise my script will fail.
Converting text into numers should work fine, so more explanation from him is needed.
Reply
#8

The Dialog was only created, for testing.

Setting the SpecialAction with a command is also not working.
The code of the dialog ist correct, since inputtext holds the text of the listitem.

It's how I said, only this 3 SpecialActions are not working, what breaks some scripts.
Replacing the SpecialAction with animations, will cause sync problems.
So even not a solution
Reply
#9

Quote:
Originally Posted by NetKiel
Посмотреть сообщение
The Dialog was only created, for testing.

Setting the SpecialAction with a command is also not working.
The code of the dialog ist correct, since inputtext holds the text of the listitem.

It's how I said, only this 3 SpecialActions are not working, what breaks some scripts.
Replacing the SpecialAction with animations, will cause sync problems.
So even not a solution
Oh, my bad
You're right. I confirm this.
Reply
#10

I guess you're testing these on CJ skin, and it's not supported. I'm pretty sure that code works for the other skins, because I tried them in 0.3x RC before.
If you are, it's a bug for quite a long time but it's not fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)