SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/12/2013, 09:23 PM   #1
Pettersen
Big Clucker
 
Pettersen's Avatar
 
Join Date: Apr 2013
Location: San Andreas
Posts: 152
Reputation: 9
Default **DELETE**

**DELETE
__________________

Last edited by Pettersen; 28/12/2013 at 11:40 PM.
Pettersen is offline   Reply With Quote
Old 25/12/2013, 11:32 PM   #2
iPrivate
Big Clucker
 
iPrivate's Avatar
 
Join Date: Nov 2013
Posts: 187
Reputation: 37
Default Re: 2 Dialogs crashes..

Remove
pawn Code:
ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose class","MILITARY\nCIVIL", "Choose", "");

from the Register dialog and put it under OnPlayerRequestClass. Conclusion:

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
       ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose class","MILITARY\nCIVIL", "Choose", "");
       return 1;
}
__________________
iPrivate is offline   Reply With Quote
Old 25/12/2013, 11:38 PM   #3
Pettersen
Big Clucker
 
Pettersen's Avatar
 
Join Date: Apr 2013
Location: San Andreas
Posts: 152
Reputation: 9
Default **DELETE**

**DELETE
__________________

Last edited by Pettersen; 28/12/2013 at 11:40 PM.
Pettersen is offline   Reply With Quote
Old 25/12/2013, 11:46 PM   #4
iPrivate
Big Clucker
 
iPrivate's Avatar
 
Join Date: Nov 2013
Posts: 187
Reputation: 37
Default Re: 2 Dialogs crashes..

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(dialogid == DIALOG_REGISTER)
     }
          if (!response) return Kick(playerid);
          if(response)
          {
               if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering", "You have entered an invalid password.\nType your password below to register a new account.", "Register", "Quit");
               new INI:File = INI_Open(UserPath(playerid));
               INI_SetTag(File,"data");
               INI_WriteInt(File,"Password",udb_hash(inputtext));
               INI_WriteInt(File,"Cash",0);
               INI_WriteInt(File,"Admin",0);
               INI_WriteInt(File,"Kills",0);
               INI_WriteInt(File,"Deaths",0);
               INI_Close(File);
          }
     }
     if(dialogid == DIALOG_CLASS)
     {
         if(response)
         {
               if(listitem == 0) //--MILITARY--//
               {
                     gPlayerClass[playerid] = MILITARY;
                     PickedClass[playerid] = 1;
                     SetPlayerColor(playerid,0xFF000000);
                     SetPlayerVirtualWorld(playerid, 0);
                     TogglePlayerControllable(playerid, 1);
                     SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
                     SpawnPlayer(playerid);
               }
               if(listitem == 1) //--CIVIL--//
               {
                     gPlayerClass[playerid] = CIVIL;
                     PickedClass[playerid] = 1;
                     SetPlayerColor(playerid,0xFF000000);
                     SetPlayerVirtualWorld(playerid, 0);
                     TogglePlayerControllable(playerid, 1);
                     SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
                     SpawnPlayer(playerid);
                }
                return 1;
          }
     }
     if(dialogid == DIALOG_LOGIN)
     {
          if (!response) return Kick (playerid);
          if(response)
          {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                }
                else
                {
                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "You have entered an incorrect password.\nType your password below to login.", "Login", "Quit");
                }
                return 1;
            }
        }
        return 1;
}
__________________
iPrivate is offline   Reply With Quote
Old 26/12/2013, 04:37 PM   #5
Pettersen
Big Clucker
 
Pettersen's Avatar
 
Join Date: Apr 2013
Location: San Andreas
Posts: 152
Reputation: 9
Default **DELETE**

**DELETE
__________________

Last edited by Pettersen; 28/12/2013 at 11:40 PM.
Pettersen is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Game crashes with dialogs leong124 Bug Reports 55 28/10/2016 06:07 AM
Games Crashes on Dialogs ChristofferHoffmann Scripting Help 15 02/09/2012 02:04 PM
Server crashes because of dialogs Kyle_Olsen Help Archive 13 06/08/2011 11:22 PM
My game crashes cause of Dialogs.. Ehab1911 Help Archive 4 22/07/2011 01:01 PM


All times are GMT. The time now is 06:18 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.