Jump to content

Pablo_Escobarz

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Pablo_Escobarz

  1. Hi! Im'm trying to make spectate system using 'attachTo' function: https://wiki.rage.mp/index.php?title=Entity::attachTo

    I'm using the function like this:

    localplayer.attachTo(target.handle,  0, 0, 0, 0, 0, 0, 0, true, false, false, true, 0, false);

    + player.Transparency setted to 0 so the attached player can be invisible but here is the problem: The parameter 'collision' is set to FALSE but players can still hit each other.

    Tried to use "setVisible' or 'setCollision' but still failed..

    Is it possible to make a spectator system with this function or is there another option?

    Thanks!

  2. For me it was the events name:

    Events.Add("CheckRegisterDialog", OnDialogResponse);
                Events.Add("ShowRegister", OnRequestDialog);

    to:

     

                Events.Add("dialog_response", OnDialogResponse);
                Events.Add("create_dialog", OnRequestDialog);
    

    It's fixed, thanks anyway.

  3. Hi guys! I'm using SAMP dialogs by adri1

     

    I created the dialog, it shows up, but the function OnDialogResponse never gets called. A working example with the samp dialogs would be helpful.

    My code (clientside)

    public class Login : Events.Script
        {
            Dialog DIALOG_REGISTER;
            public Login()
            {
                Events.Add("CheckRegisterDialog", OnDialogResponse);
                Events.Add("ShowRegister", OnRequestDialog);
            }
    
            public void OnRequestDialog(object[] args)
            {
                switch ((int)args[0])
                {
                    case 4:
                        DIALOG_REGISTER = new Dialog("DIALOG_REGISTER", "Server Register", "Your password:", new string[] { "Next", "Exit" }, null, null, " ");
                        break;
                }
            }
    
            public void OnDialogResponse(object[] args)
            {
    
                /*
                   args[0] = dialog_name
                   args[1] = response
                   args[2] = listitem
                   args[3] = inputtext
                   args[4] = inputpassword
                */
                Chat.Output("dialog_name: " + args[0].ToString());
                Chat.Output("response: " + (int)args[1]);
                Chat.Output("listitem: " + (int)args[2]);
                Chat.Output("inputtext: " + args[3].ToString());
                Chat.Output("inputpassword: " + args[4].ToString());
                DIALOG_REGISTER.Destroy();
            }
        }

    This is how i trigger the events (serverside)

    NAPI.ClientEvent.TriggerClientEvent(player, "CheckRegisterDialog", 4);
    NAPI.ClientEvent.TriggerClientEvent(player, "ShowRegister", 4);

    4 is the number of dialog password type.

    In the example Test.cs from adri1 an example of how to trigger the response event.

    Thanks!

×
×
  • Create New...