SA-MP Forums Archive
Game Text help? - 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)
+--- Thread: Game Text help? (/showthread.php?tid=454940)



Game Text help? - JimmyCh - 31.07.2013

Hi guys, so I decided to create a kind-of useful filterscript, but I'm getting an error.
I will just show you my codes for some help:
pawn Код:
if(dialogid == 102)
    {
        if(response)
        {
                new inputtext3;
                ChosenText = inputtext3;
                SendClientMessage(playerid, -1, "Done! You have successfully created the game text for everyone!");
                GameTextForAll(ChosenText,"inputtext2 * 1000", ChosenStyle);
                return 1;
        }
          }
So after you type something in the dialog(last step), it must send game text to everyone, etc..

Now I'm getting these errors:
Код:
error 035: argument type mismatch (argument 1)
warning 204: symbol is assigned a value that is never used: "ChosenText"
Hopefully when I wake up tomorrow, I will see an answer to this so I can release it.
Thank you!


Re: Game Text help? - dEcooR - 31.07.2013

Dude do you have this ChosenText as global variable


Re: Game Text help? - JimmyCh - 31.07.2013

EDIT:
So I remove the time from the system, but now it doesn't show anything on the screen.
Here is my code:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) == 1)
                    {
                        new string[128];
                        format(string, sizeof(string), "%s", inputtext3);
                        switch(ChosenStyle)
                        {
                        case 0:
                            {
                            GameTextForPlayer(i, string, 1, 0);
                            }
                        case 1:
                            {
                            GameTextForPlayer(i, string, 1, 1);
                            }
                        case 5:
                            {
                            GameTextForPlayer(i, string, 1, 5);
                            }
                        }
                    }
                }



Re: Game Text help? - ThePhenix - 31.07.2013

PHP код:
if(dialogid == 102)
    {
        if(
response)
        {
                new 
inputtext3;
                
ChosenText inputtext3;
                
SendClientMessage(playerid, -1"Done! You have successfully created the game text for everyone!");
                
GameTextForAll(ChosenText,1000ChosenStyle);//You're not calling any inputtext2 function here..
                
return 1;
        }
   } 



Re: Game Text help? - JimmyCh - 31.07.2013

@ThePhenix, I changed my code, so if you could please help on that..
Before, I was having a problem that it sends the game text for like 5 milli seconds lol, then I removed the time input, and added the gametexts which appear for some time(IDs 0, 1, and 5), but now it won't show anything on the screen.


Re: Game Text help? - ThePhenix - 31.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
EDIT:
So I remove the time from the system, but now it doesn't show anything on the screen.
Here is my code:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) == 1)
                    {
                        new string[128];
                        format(string, sizeof(string), "%s", inputtext3);
                        switch(ChosenStyle)
                        {
                        case 0:
                            {
                            GameTextForPlayer(i, string, 1, 0);
                            }
                        case 1:
                            {
                            GameTextForPlayer(i, string, 1, 1);
                            }
                        case 5:
                            {
                            GameTextForPlayer(i, string, 1, 5);
                            }
                        }
                    }
                }
GameTextForPlayer(const string[], time, style)
time The time you want the text to show up. This is in milliseconds.
https://sampwiki.blast.hk/wiki/GameTextForAll

Your time is set to 1 milliseconds, that's why It's not visible. Change it to 1000 = 1 second or 2000 = 2 seconds.


Re: Game Text help? - JimmyCh - 31.07.2013

But if you check the game text type, I chose the ones with constant timing, 8-9 seconds and 3 seconds, that's why I've set my time to that, might be the problem?


Re: Game Text help? - ThePhenix - 31.07.2013

Anyways..

https://sampwiki.blast.hk/wiki/GameTextForPlayer

The time is in milliseconds and you have set it to 1.


Re: Game Text help? - JimmyCh - 31.07.2013

Dude, I just set it to 10000 and it's still not appearing.
Plus I told you the game text style I chose has a constant timing..
Even after I changed to 10000 it still doesn't show..


Re: Game Text help? - ThePhenix - 31.07.2013

Look at this example:
PHP код:
#define DIALOG_DSAY 0
CMD:dsay(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_DSAYDIALOG_STYLE_INPUT"Game Text""Please insert the Game Text For Player""Ok""Close");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_DSAY:
        {
            if(
response)
            {
                
GameTextForAll(inputtext30005);
            }
        }
    }
    return 
1;