HELP me to fix those errors
#1

Код:
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(450) : warning 217: loose indentation
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(590) : warning 217: loose indentation
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(610) : error 017: undefined symbol "dcmd_changepass"
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(828) : error 002: only a single statement (or expression) can follow each "case"
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(828) : error 017: undefined symbol "file"
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(828) : warning 215: expression has no effect
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(828) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\ADMINI~1\Bureau\ALAE\LATDM\GAMEMO~1\LATDM.pwn(828) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
line 828 :
pawn Код:
new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
line 610:
pawn Код:
dcmd(changepass,10,cmdtext);
i hope you help me .
Reply
#2

Do you have the Dcmd define under the includes?
pawn Код:
#include < a_samp >
// Rest
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
I can't help you with only two lines. Show us from lines 815 - 835
Reply
#3

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Do you have the Dcmd define under the includes?
pawn Код:
#include < a_samp >
// Rest
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
I can't help you with only two lines. Show us from lines 815 - 835
yes i have defined dcmd....

ok i will show u all the Public ondialogresponse(line 745 to line 1026) because the error is around :
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    //====================================WEAPONS DIALOG=============================//
        if(response)// They pressed the first button.
    {
        switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
            case 3:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:// The first item listed
                    {
                        if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1800);
                        GivePlayerWeapon(playerid , 22 , 30);
                    }
                    case 1: // The second item listed
                    {
                        if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2500);
                        GivePlayerWeapon(playerid, 24 , 40);
                    }
                    case 2: // The third item listed
                    {
                        if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -4500);
                        GivePlayerWeapon(playerid, 31 , 120);
                    }
                    case 3: // The fourth item listed
                    {
                        if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3500);
                        GivePlayerWeapon(playerid, 30 , 145);
                    }
                    case 4: // The fifth item listed
                    {
                        if(GetPlayerMoney(playerid) < 650) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -650);
                        SendClientMessage(playerid, COLOR_GRAD2 , "you use vip pack to buy this weapon");
                    }
                }
            }
            case 4:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
                {
                    case 0:// The first item listed
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "============Normal Player Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $500 and +1 score.");
                        SendClientMessage(playerid, COLOR_OOC, "Spawn: you spawn with your normal money saved in your account.");
                        SendClientMessage(playerid, COLOR_OOC, "Shop: You can use /shop in your HQ to buy some weapons(exept vip's weapons)");
                        SendClientMessage(playerid, COLOR_OOC, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-60$).");
                    }
                    case 1: // The second item listed
                    {
                        SendClientMessage(playerid, COLOR_GREY, "============Silver VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $1000 and +2 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn $30 + colt45 with 20ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves and more other stuffs.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-40$).");
                    }
                    case 2: // The third item listed
                    {
                        SendClientMessage(playerid, COLOR_YELLOW3, "============Gold VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $2000 and +3 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn $100 + colt45 with 50ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves+grenades and more other stuffs(/klevar..).");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-20$).");
                    }
                    case 3: // The fourth item listed
                    {
                        SendClientMessage(playerid, COLOR_NICERED, "============Premium VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $4000 and +4 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn 250$ + colt45 and Shotgun with 50ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves+grenades and more other stuffs(/klevar..).");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , go to LA hospital and buyhel(cost 0$) .");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Minigun: you can buy a minigun with 350ammo for $600 .");
                    }
                }
            }
            //===============================================LOGIN/REGISTER============//
                new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
    format(file,sizeof(file),PlayerFile,Name);
    case 9696: //Choosing
    {
    if(!response)
    {
    if(!fexist(file))
    {
    ShowPlayerDialog(playerid,135,DIALOG_STYLE_INPUT,"Registration","Please Type A Chosen Password Below To Register","Register","Cancel");
    }
    else if(fexist(file))
    {
    SendClientMessage(playerid,COLOR_RED,"You Are Already Registered");
    ShowPlayerDialog(playerid,9696,DIALOG_STYLE_MSGBOX,"Login & Register Dialog By Etch","Welcome To The Server","Login","Register");
    }
    }
    if(response)
    {
    if(fexist(file))
    {
    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
    }
    else if(!fexist(file))
    {
    SendClientMessage(playerid,COLOR_RED,"You Need To Register In Order To Login");
    ShowPlayerDialog(playerid,9696,DIALOG_STYLE_MSGBOX,"Login & Register Dialog By Etch","Welcome To The Server","Login","Register");
    }
    }
    }
    case 135: //Registration
    {
    if(!response)
    {
    SendClientMessage(playerid,COLOR_RED,"You Have To Register In Order To Play!");
    ShowPlayerDialog(playerid,135,DIALOG_STYLE_INPUT,"Registration","Please Type A Chosen Password Below To Register","Register","Cancel");
    }
    if(response)
    {
    new Float:Health,Float:Armour; GetPlayerHealth(playerid,Health); GetPlayerArmour(playerid,Armour);
    dini_Create(file);
    new pName[24]; GetPlayerName(playerid,pName,24); new IP[16]; GetPlayerIp(playerid,IP,16);
    dini_Set(file, "Name", pName);
    dini_Set(file, "Ip Adress", IP);
    dini_IntSet(file, "Password", udb_hash(inputtext));
    dini_IntSet(file, "Money",0);
    dini_IntSet(file, "Score",0);
    dini_IntSet(file, "Kills",0);
    dini_IntSet(file, "Deaths",0);
    dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
    dini_IntSet(file,"Wanted Level",GetPlayerWantedLevel(playerid));
    GetPlayerWeaponData(playerid,0,pInfo[playerid][Wep1],pInfo[playerid][Ammo1]);
    GetPlayerWeaponData(playerid,1,pInfo[playerid][Wep2],pInfo[playerid][Ammo2]);
    GetPlayerWeaponData(playerid,2,pInfo[playerid][Wep3],pInfo[playerid][Ammo3]);
    GetPlayerWeaponData(playerid,3,pInfo[playerid][Wep4],pInfo[playerid][Ammo4]);
    GetPlayerWeaponData(playerid,4,pInfo[playerid][Wep5],pInfo[playerid][Ammo5]);
    GetPlayerWeaponData(playerid,5,pInfo[playerid][Wep6],pInfo[playerid][Ammo6]);
    GetPlayerWeaponData(playerid,6,pInfo[playerid][Wep7],pInfo[playerid][Ammo7]);
    GetPlayerWeaponData(playerid,7,pInfo[playerid][Wep8],pInfo[playerid][Ammo8]);
    dini_IntSet(file,"Weapon 1",pInfo[playerid][Wep1]);
    dini_IntSet(file,"Ammo 1",pInfo[playerid][Ammo1]);
    dini_IntSet(file,"Weapon 2",pInfo[playerid][Wep2]);
    dini_IntSet(file,"Ammo 2",pInfo[playerid][Ammo2]);
    dini_IntSet(file,"Weapon 3",pInfo[playerid][Wep3]);
    dini_IntSet(file,"Ammo 3",pInfo[playerid][Ammo3]);
    dini_IntSet(file,"Weapon 4",pInfo[playerid][Wep4]);
    dini_IntSet(file,"Ammo 4",pInfo[playerid][Ammo4]);
    dini_IntSet(file,"Weapon 5",pInfo[playerid][Wep5]);
    dini_IntSet(file,"Ammo 5",pInfo[playerid][Ammo5]);
    dini_IntSet(file,"Weapon 6",pInfo[playerid][Wep6]);
    dini_IntSet(file,"Ammo 6",pInfo[playerid][Ammo6]);
    dini_IntSet(file,"Weapon 7",pInfo[playerid][Wep7]);
    dini_IntSet(file,"Ammo 7",pInfo[playerid][Ammo7]);
    dini_IntSet(file,"Weapon 8",pInfo[playerid][Wep8]);
    dini_IntSet(file,"Ammo 8",pInfo[playerid][Ammo8]);
    dini_FloatSet(file,"Health",Health);
    dini_FloatSet(file,"Armour",Armour);
    pInfo[playerid][Registered] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"You Have Succesfully Registered");
    ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"What's Your Gendre","Male\nFemale","Select","Cancel");
    }
    }
    case 246: //Logging
    {
    if(!response)
    {
    SendClientMessage(playerid,COLOR_RED,"You Have To Login In Order To Play!");
    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
    }
    if(response)
    {
    if(udb_hash(inputtext) != dini_Int(file, "Password"))
    {
    SendClientMessage(playerid,COLOR_RED,"Wrong Password");
    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
    }
    else
    {
    SetPlayerMoney(playerid,dini_Int(file,"Money"));
    SetPlayerScore(playerid,dini_Int(file,"Score"));
    pInfo[playerid][Kills] = dini_Int(file,"Kills");
    pInfo[playerid][Deaths] = dini_Int(file,"Deaths");
    SendClientMessage(playerid,COLOR_YELLOW,"You Have Successfully Logged In");
    pInfo[playerid][LoggedIn] = 1;
    if(strcmp(dini_Get(file,"Gendre"),"Male") == 0)
    {
    pInfo[playerid][Gendre] = Male;
    }
    else if(strcmp(dini_Get(file,"Gendre"),"Female") == 0)
    {
    pInfo[playerid][Gendre] = Female;
    }
    pInfo[playerid][Age] = dini_Int(file,"Age");
    timeupdate = SetTimerEx("TimeOnServer",60000,1,"i",playerid);
    TimE[playerid] = dini_Int(file,"Time On Server");
    }
    }
    }
    case 9797:
    {
    if(!response) return SendClientMessage(playerid,COLOR_RED,"You Canceled");
    if(response)
    {
    if(udb_hash(inputtext) != dini_Int(file, "Password"))
    {
    SendClientMessage(playerid,COLOR_RED,"Wrong Password");
    ShowPlayerDialog(playerid,9797,DIALOG_STYLE_INPUT,"Password Change","Please Type Your Old Password :","Done","Cancel");
    }
    else
    {
    ShowPlayerDialog(playerid,9898,DIALOG_STYLE_INPUT,"Password Change","Please Type Your New Password :","Done","Cancel");
    }
    }
    }
    case 9898:
    {
    if(!response) return SendClientMessage(playerid,COLOR_RED,"You Canceled");
    if(response)
    {
    dini_IntSet(file, "Password", udb_hash(inputtext));
    SendClientMessage(playerid,COLOR_YELLOW,"You Have Succesfully Changed Your Password");
    }
    }
    case 9999:
    {
    if(!response)
    {
    ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"What's Your Gendre","Male\nFemale","Select","Cancel");
    SendClientMessage(playerid,COLOR_RED,"You Have To Choose Your Gendre");
    }
    if(response)
    {
    if(listitem == 0)
    {
    dini_Set(file,"Gendre","Male");
    ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
    }
    if(listitem == 1)
    {
    dini_Set(file,"Gendre","Female");
    ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
    }
    }
    }
    case 1010:
    {
    if(!response)
    {
    SendClientMessage(playerid,COLOR_RED,"You Have To Choose Your Age");
    ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
    }
    if(response)
    {
    if(IsNumeric(inputtext))
    {
    dini_IntSet(file,"Age",strval(inputtext));
    ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"MSN","Type you MSN please, you need it if you forget your pass:","Done","Cancel");
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
    ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
    }
    }
    }
    case 1111:
    {
    if(!response)
    {
    SendClientMessage(playerid,COLOR_RED,"Please enter a VALIDE MSN");
    ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"MSN","Type your MSN please, you need it if your forget your pass","Done","Cancel");
    }
    if(response)
    {
    dini_Set(file,"Country",inputtext);
    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
    }
    }
    return 1;
}
Reply
#4

You can't use variables between cases. Add them at the top of the Callback, under the public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) OR in every case you are using the path. Also, return 0 if it's a FS, else if return 1;
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// Main
    new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
    format(file,sizeof(file),PlayerFile,Name);
//====================================WEAPONS DIALOG=============================//
    if(response) {                                // They pressed the first button.
        switch(dialogid) {                        // If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
            case 3:                               // Our dialog!
            {
                switch(listitem) {                // Checking which listitem was selected
                    case 0:                       // The first item listed
                    {
                        if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1800);
                        GivePlayerWeapon(playerid , 22 , 30);
                    }
                    case 1:                       // The second item listed
                    {
                        if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2500);
                        GivePlayerWeapon(playerid, 24 , 40);
                    }
                    case 2:                       // The third item listed
                    {
                        if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -4500);
                        GivePlayerWeapon(playerid, 31 , 120);
                    }
                    case 3:                       // The fourth item listed
                    {
                        if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3500);
                        GivePlayerWeapon(playerid, 30 , 145);
                    }
                    case 4:                       // The fifth item listed
                    {
                        if(GetPlayerMoney(playerid) < 650) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -650);
                        SendClientMessage(playerid, COLOR_GRAD2 , "you use vip pack to buy this weapon");
                    }
                }
            }
            case 4:                               // Our dialog!
            {
                switch(listitem) {                // Checking which listitem was selected
                    case 0:                       // The first item listed
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "============Normal Player Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $500 and +1 score.");
                        SendClientMessage(playerid, COLOR_OOC, "Spawn: you spawn with your normal money saved in your account.");
                        SendClientMessage(playerid, COLOR_OOC, "Shop: You can use /shop in your HQ to buy some weapons(exept vip's weapons)");
                        SendClientMessage(playerid, COLOR_OOC, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-60$).");
                    }
                    case 1:                       // The second item listed
                    {
                        SendClientMessage(playerid, COLOR_GREY, "============Silver VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $1000 and +2 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn $30 + colt45 with 20ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves and more other stuffs.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-40$).");
                    }
                    case 2:                       // The third item listed
                    {
                        SendClientMessage(playerid, COLOR_YELLOW3, "============Gold VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $2000 and +3 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn $100 + colt45 with 50ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves+grenades and more other stuffs(/klevar..).");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , you must go to LA Hospital and /buyheal(cost-20$).");
                    }
                    case 3:                       // The fourth item listed
                    {
                        SendClientMessage(playerid, COLOR_NICERED, "============Premium VIP Privilages:==========");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Kill:Whene you kill someone , you win $4000 and +4 score.");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Spawn: each time you spawn, you earn 250$ + colt45 and Shotgun with 50ammo");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Shop: You can acces to SMG+Knife+Motoloves+grenades and more other stuffs(/klevar..).");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Heal: To heal yourself , go to LA hospital and buyhel(cost 0$) .");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Minigun: you can buy a minigun with 350ammo for $600 .");
                    }
                }
            }
//===============================================LOGIN/REGISTER============//
            case 9696:                            //Choosing
            {
                if(!response) {
                    if(!fexist(file)) {
                        ShowPlayerDialog(playerid,135,DIALOG_STYLE_INPUT,"Registration","Please Type A Chosen Password Below To Register","Register","Cancel");
                    }
                    else if(fexist(file)) {
                        SendClientMessage(playerid,COLOR_RED,"You Are Already Registered");
                        ShowPlayerDialog(playerid,9696,DIALOG_STYLE_MSGBOX,"Login & Register Dialog By Etch","Welcome To The Server","Login","Register");
                    }
                }
                if(response) {
                    if(fexist(file)) {
                        ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
                    }
                    else if(!fexist(file)) {
                        SendClientMessage(playerid,COLOR_RED,"You Need To Register In Order To Login");
                        ShowPlayerDialog(playerid,9696,DIALOG_STYLE_MSGBOX,"Login & Register Dialog By Etch","Welcome To The Server","Login","Register");
                    }
                }
            }
            case 135:                             //Registration
            {
                if(!response) {
                    SendClientMessage(playerid,COLOR_RED,"You Have To Register In Order To Play!");
                    ShowPlayerDialog(playerid,135,DIALOG_STYLE_INPUT,"Registration","Please Type A Chosen Password Below To Register","Register","Cancel");
                }
                if(response) {
                    new Float:Health,Float:Armour; GetPlayerHealth(playerid,Health); GetPlayerArmour(playerid,Armour);
                    dini_Create(file);
                    new pName[24]; GetPlayerName(playerid,pName,24); new IP[16]; GetPlayerIp(playerid,IP,16);
                    dini_Set(file, "Name", pName);
                    dini_Set(file, "Ip Adress", IP);
                    dini_IntSet(file, "Password", udb_hash(inputtext));
                    dini_IntSet(file, "Money",0);
                    dini_IntSet(file, "Score",0);
                    dini_IntSet(file, "Kills",0);
                    dini_IntSet(file, "Deaths",0);
                    dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
                    dini_IntSet(file,"Wanted Level",GetPlayerWantedLevel(playerid));
                    GetPlayerWeaponData(playerid,0,pInfo[playerid][Wep1],pInfo[playerid][Ammo1]);
                    GetPlayerWeaponData(playerid,1,pInfo[playerid][Wep2],pInfo[playerid][Ammo2]);
                    GetPlayerWeaponData(playerid,2,pInfo[playerid][Wep3],pInfo[playerid][Ammo3]);
                    GetPlayerWeaponData(playerid,3,pInfo[playerid][Wep4],pInfo[playerid][Ammo4]);
                    GetPlayerWeaponData(playerid,4,pInfo[playerid][Wep5],pInfo[playerid][Ammo5]);
                    GetPlayerWeaponData(playerid,5,pInfo[playerid][Wep6],pInfo[playerid][Ammo6]);
                    GetPlayerWeaponData(playerid,6,pInfo[playerid][Wep7],pInfo[playerid][Ammo7]);
                    GetPlayerWeaponData(playerid,7,pInfo[playerid][Wep8],pInfo[playerid][Ammo8]);
                    dini_IntSet(file,"Weapon 1",pInfo[playerid][Wep1]);
                    dini_IntSet(file,"Ammo 1",pInfo[playerid][Ammo1]);
                    dini_IntSet(file,"Weapon 2",pInfo[playerid][Wep2]);
                    dini_IntSet(file,"Ammo 2",pInfo[playerid][Ammo2]);
                    dini_IntSet(file,"Weapon 3",pInfo[playerid][Wep3]);
                    dini_IntSet(file,"Ammo 3",pInfo[playerid][Ammo3]);
                    dini_IntSet(file,"Weapon 4",pInfo[playerid][Wep4]);
                    dini_IntSet(file,"Ammo 4",pInfo[playerid][Ammo4]);
                    dini_IntSet(file,"Weapon 5",pInfo[playerid][Wep5]);
                    dini_IntSet(file,"Ammo 5",pInfo[playerid][Ammo5]);
                    dini_IntSet(file,"Weapon 6",pInfo[playerid][Wep6]);
                    dini_IntSet(file,"Ammo 6",pInfo[playerid][Ammo6]);
                    dini_IntSet(file,"Weapon 7",pInfo[playerid][Wep7]);
                    dini_IntSet(file,"Ammo 7",pInfo[playerid][Ammo7]);
                    dini_IntSet(file,"Weapon 8",pInfo[playerid][Wep8]);
                    dini_IntSet(file,"Ammo 8",pInfo[playerid][Ammo8]);
                    dini_FloatSet(file,"Health",Health);
                    dini_FloatSet(file,"Armour",Armour);
                    pInfo[playerid][Registered] = 1;
                    SendClientMessage(playerid,COLOR_YELLOW,"You Have Succesfully Registered");
                    ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"What's Your Gendre","Male\nFemale","Select","Cancel");
                }
            }
            case 246:                             //Logging
            {
                if(!response) {
                    SendClientMessage(playerid,COLOR_RED,"You Have To Login In Order To Play!");
                    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
                }
                if(response) {
                    if(udb_hash(inputtext) != dini_Int(file, "Password")) {
                        SendClientMessage(playerid,COLOR_RED,"Wrong Password");
                        ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
                    }
                    else {
                        SetPlayerMoney(playerid,dini_Int(file,"Money"));
                        SetPlayerScore(playerid,dini_Int(file,"Score"));
                        pInfo[playerid][Kills] = dini_Int(file,"Kills");
                        pInfo[playerid][Deaths] = dini_Int(file,"Deaths");
                        SendClientMessage(playerid,COLOR_YELLOW,"You Have Successfully Logged In");
                        pInfo[playerid][LoggedIn] = 1;
                        if(strcmp(dini_Get(file,"Gendre"),"Male") == 0) {
                            pInfo[playerid][Gendre] = Male;
                        }
                        else if(strcmp(dini_Get(file,"Gendre"),"Female") == 0) {
                            pInfo[playerid][Gendre] = Female;
                        }
                        pInfo[playerid][Age] = dini_Int(file,"Age");
                        timeupdate = SetTimerEx("TimeOnServer",60000,1,"i",playerid);
                        TimE[playerid] = dini_Int(file,"Time On Server");
                    }
                }
            }
            case 9797:
            {
                if(!response) return SendClientMessage(playerid,COLOR_RED,"You Canceled");
                if(response) {
                    if(udb_hash(inputtext) != dini_Int(file, "Password")) {
                        SendClientMessage(playerid,COLOR_RED,"Wrong Password");
                        ShowPlayerDialog(playerid,9797,DIALOG_STYLE_INPUT,"Password Change","Please Type Your Old Password :","Done","Cancel");
                    }
                    else {
                        ShowPlayerDialog(playerid,9898,DIALOG_STYLE_INPUT,"Password Change","Please Type Your New Password :","Done","Cancel");
                    }
                }
            }
            case 9898:
            {
                if(!response) return SendClientMessage(playerid,COLOR_RED,"You Canceled");
                if(response) {
                    dini_IntSet(file, "Password", udb_hash(inputtext));
                    SendClientMessage(playerid,COLOR_YELLOW,"You Have Succesfully Changed Your Password");
                }
            }
            case 9999:
            {
                if(!response) {
                    ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"What's Your Gendre","Male\nFemale","Select","Cancel");
                    SendClientMessage(playerid,COLOR_RED,"You Have To Choose Your Gendre");
                }
                if(response) {
                    if(listitem == 0) {
                        dini_Set(file,"Gendre","Male");
                        ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
                    }
                    if(listitem == 1) {
                        dini_Set(file,"Gendre","Female");
                        ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
                    }
                }
            }
            case 1010:
            {
                if(!response) {
                    SendClientMessage(playerid,COLOR_RED,"You Have To Choose Your Age");
                    ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
                }
                if(response) {
                    if(IsNumeric(inputtext)) {
                        dini_IntSet(file,"Age",strval(inputtext));
                        ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"MSN","Type you MSN please, you need it if you forget your pass:","Done","Cancel");
                    }
                    else {
                        SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
                        ShowPlayerDialog(playerid,1010,DIALOG_STYLE_INPUT,"Age","What's Your Age","Done","Cancel");
                    }
                }
            }
            case 1111:
            {
                if(!response) {
                    SendClientMessage(playerid,COLOR_RED,"Please enter a VALIDE MSN");
                    ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"MSN","Type your MSN please, you need it if your forget your pass","Done","Cancel");
                }
                if(response) {
                    dini_Set(file,"Country",inputtext);
                    ShowPlayerDialog(playerid,246,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
                }
            }
        }
    }
    return 1;
}
Reply
#5

Thank you a lot ! errors fixed whene i get rep i will give u thank u again
Reply
#6

one thing : whene i conect in the server it says login or register , whene i click on register it doesn't show to me the dialog
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)