SA-MP Forums Archive
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: Help. (/showthread.php?tid=327544)



Help. - Nicholas. - 21.03.2012

Hello SA:MP Community.

In the picture below shows my basic Register & Login System (Dialogs) (Textdraws).

- I have hidden my textdraws.

What I want to do is change the back ground where the player is viewing?

Another problem I have is that "Connected to" keeps showing up although I have use this code to clear the chat "OnPlayerConnect"

pawn Код:
for(new chat = 0; chat <= 100; chat++)
    {
    SendClientMessage(playerid,COLOR_WHITE," ");
    }



Re: Help. - emokidx - 21.03.2012

the connected to "sever" is sent by the client, so i don't think you can do much about it, or maybe i don't know much about it.

for the view try putting "SetPlayerCameraPos" or/and "SetPlayerCameraLookAt" on the OnPlayerConnect callback
maybe


Re: Help. - Baboon - 21.03.2012

You CAN NOT do that, sorry.


Re: Help. - Bogdan1992 - 21.03.2012

I think you can't evade this because when you enter the game it loads everything from OnPlayerConnect and when he almost hits the last line it will show that msg (i think).


Re: Help. - Nicholas. - 21.03.2012

Okay, Thank you all for clearing that up, I just wanted to know if I could skip it or not.

I know about the....

pawn Код:
SetPlayerPos
SetPlayerCameraPos
SetPlayerCameraLookAt

Let me show my code:

pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
   
    SetPlayerPos(playerid, 637.6825,857.8131,-50.3321);
    SetPlayerCameraPos(playerid, 561.4714,932.8723,24.4060);
    SetPlayerCameraLookAt(playerid, 637.6825,857.8131,-40.3321);
    TogglePlayerControllable(playerid, false);

    new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');
    format(string, sizeof(string), "%s has joined the server.", pname);
    SendClientMessageToAll(COLOR_GREY, string);
   
    PlayAudioStreamForPlayer( playerid, "-----" );

    for(new chat = 0; chat <= 100; chat++)
    {
    SendClientMessage(playerid,COLOR_WHITE," ");
    }
   
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"» Login",""COL_WHITE"-------------------------","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"» Registration",""COL_WHITE"----------------------","Register","Quit");
    }



Re: Help. - Nicholas. - 21.03.2012

Still looking for some help on this.


Re: Help. - Bogdan1992 - 21.03.2012

Try this.

Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);

    new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');
    format(string, sizeof(string), "%s has joined the server.", pname);
    SendClientMessageToAll(COLOR_GREY, string);
    
    PlayAudioStreamForPlayer( playerid, "-----" );

    for(new chat = 0; chat <= 100; chat++)
    {
    SendClientMessage(playerid,COLOR_WHITE," ");
    }
    
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"» Login",""COL_WHITE"-------------------------","Login","Quit");
    
    SetPlayerPos(playerid, 637.6825,857.8131,-50.3321);
    SetPlayerCameraPos(playerid, 561.4714,932.8723,24.4060);
    SetPlayerCameraLookAt(playerid, 637.6825,857.8131,-40.3321);
    TogglePlayerControllable(playerid, false);
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"» Registration",""COL_WHITE"----------------------","Register","Quit");
    
    SetPlayerPos(playerid, 637.6825,857.8131,-50.3321);
    SetPlayerCameraPos(playerid, 561.4714,932.8723,24.4060);
    SetPlayerCameraLookAt(playerid, 637.6825,857.8131,-40.3321);
    TogglePlayerControllable(playerid, false);
    }



Re: Help. - Nicholas. - 21.03.2012

Didn't work.


Re: Help. - Nicholas. - 21.03.2012

It works now but only when I remove this code:

pawn Код:
for(new chat = 0; chat <= 100; chat++)
    {
    SendClientMessage(playerid,COLOR_WHITE," ");
    }
Is there any other way around this without removing this code?


Re: Help. - Bogdan1992 - 21.03.2012

Hmm try now.
pawn Код:
for(new chat=0; chat < 100; chat++) SendClientMessage(playerid,COLOR_WHITE," ");