[Dini Help] Saving fightstyle. Errors in compiling.
#1

Look, so I *tried* to make the fightstyle save in the .ini of player. But I get errors in compiling.
Код:
D:\VERY IMPORTANT STUFF\SA-MP Scripts\EL-RP\gamemodes\el-rp.pwn(9254) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Now the fightstyle training dialog :
pawn Код:
//Here
    if(dialogid == 26) //gym
    {
        if(response)
        {
            if(listitem == 0) //normal
            {
                if(GetPlayerPCash(playerid)>=1)
                {
                    PlayerInfo[playerid][pFightingStyle] = 4;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 1) //boxing
            {
                if(GetPlayerPCash(playerid)>=999)
                {
                    PlayerInfo[playerid][pFightingStyle] = 5;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    GivePlayerPCash(playerid, - 1000);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 2) //kung fu
            {
                if(GetPlayerPCash(playerid)>=999)
                {
                    PlayerInfo[playerid][pFightingStyle] = 6;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    GivePlayerPCash(playerid, - 1000);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 3) //kneehead
            {
                if(GetPlayerPCash(playerid)>=999)
                {
                    PlayerInfo[playerid][pFightingStyle] = 7;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    GivePlayerPCash(playerid, - 1000);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 4) //grabkick
            {
                if(GetPlayerPCash(playerid)>=999)
                {
                    PlayerInfo[playerid][pFightingStyle] = 15;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    GivePlayerPCash(playerid, - 1000);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
            if(listitem == 5) //elbow
            {
                if(GetPlayerPCash(playerid)>=999)
                {
                    PlayerInfo[playerid][pFightingStyle] = 26;
                    SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightingStyle]);
                    GivePlayerPCash(playerid, - 1000);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have learnt a new fighting style.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You don't have the cash for that !");
                }
            }
        }
    }
OnPlayerRegister :
pawn Код:
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string[128];

        format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));

        if(!dini_Exists(string))
        {
            dini_Create(string);
            dini_Set(string, "Key", password);
            dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
            dini_IntSet(string, "AdminJailCount", PlayerInfo[playerid][pAjailc]);
            dini_IntSet(string, "Account", PlayerInfo[playerid][pAccount]);
            dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
            dini_IntSet(string, "Level", PlayerInfo[playerid][pLevel]);
            dini_IntSet(string, "Respect", PlayerInfo[playerid][pExp]);
            dini_IntSet(string, "Arrive", PlayerInfo[playerid][pArrive]);
            dini_IntSet(string, "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
            dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
            dini_IntSet(string, "Gun1", PlayerInfo[playerid][pGun1]);
            dini_IntSet(string, "Gun2", PlayerInfo[playerid][pGun2]);
            dini_IntSet(string, "Gun3", PlayerInfo[playerid][pGun3]);
            dini_IntSet(string, "Gun4", PlayerInfo[playerid][pGun4]);
            dini_IntSet(string, "Gun5", PlayerInfo[playerid][pGun5]);
            dini_IntSet(string, "Gun6", PlayerInfo[playerid][pGun6]);
            dini_IntSet(string, "Gun7", PlayerInfo[playerid][pGun7]);
            dini_IntSet(string, "Gun8", PlayerInfo[playerid][pGun8]);
            dini_IntSet(string, "Gun9", PlayerInfo[playerid][pGun9]);
            dini_IntSet(string, "Gun10", PlayerInfo[playerid][pGun10]);
            dini_IntSet(string, "Gun11", PlayerInfo[playerid][pGun11]);
            dini_IntSet(string, "Gun12", PlayerInfo[playerid][pGun12]);
            dini_IntSet(string, "Gun13", PlayerInfo[playerid][pGun13]);
            dini_IntSet(string, "Ammo1", PlayerInfo[playerid][pAmmo1]);
            dini_IntSet(string, "Ammo2", PlayerInfo[playerid][pAmmo2]);
            dini_IntSet(string, "Ammo3", PlayerInfo[playerid][pAmmo3]);
            dini_IntSet(string, "Ammo4", PlayerInfo[playerid][pAmmo4]);
            dini_IntSet(string, "Ammo5", PlayerInfo[playerid][pAmmo5]);
            dini_IntSet(string, "Ammo6", PlayerInfo[playerid][pAmmo6]);
            dini_IntSet(string, "Ammo7", PlayerInfo[playerid][pAmmo7]);
            dini_IntSet(string, "Ammo8", PlayerInfo[playerid][pAmmo8]);
            dini_IntSet(string, "Ammo9", PlayerInfo[playerid][pAmmo9]);
            dini_IntSet(string, "Ammo10", PlayerInfo[playerid][pAmmo10]);
            dini_IntSet(string, "Ammo11", PlayerInfo[playerid][pAmmo11]);
            dini_IntSet(string, "Ammo12", PlayerInfo[playerid][pAmmo12]);
            dini_IntSet(string, "Ammo13", PlayerInfo[playerid][pAmmo13]);
            dini_FloatSet(string, "pSHealth", PlayerInfo[playerid][pSHealth]);
            dini_FloatSet(string, "Health", PlayerInfo[playerid][pHealth]);
            dini_FloatSet(string, "Pos_x", PlayerInfo[playerid][pPos_x]);
            dini_FloatSet(string, "Pos_y", PlayerInfo[playerid][pPos_y]);
            dini_FloatSet(string, "Pos_z", PlayerInfo[playerid][pPos_z]);
            dini_IntSet(string, "Int", PlayerInfo[playerid][pInt]);
            dini_IntSet(string, "Local", PlayerInfo[playerid][pLocal]);
            dini_IntSet(string, "Team", PlayerInfo[playerid][pTeam]);
            dini_IntSet(string, "Char", PlayerInfo[playerid][pModel]);
            dini_IntSet(string, "PhoneNr", PlayerInfo[playerid][pPnumber]);
            dini_IntSet(string, "House", PlayerInfo[playerid][pHousekey]);
            dini_IntSet(string, "Bizz", PlayerInfo[playerid][pPbiskey]);
            dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
            dini_IntSet(string, "FightSkill", PlayerInfo[playerid][pFightSkill]);
            dini_IntSet(string, "Sex", PlayerInfo[playerid][pSex]);
            dini_IntSet(string, "Age", PlayerInfo[playerid][pAge]);
            dini_IntSet(string, "Tutorial", PlayerInfo[playerid][pTut]);
            dini_IntSet(string, "Member", PlayerInfo[playerid][pMember]);
            dini_IntSet(string, "Rank", PlayerInfo[playerid][pRank]);
            dini_IntSet(string, "Crashed", PlayerInfo[playerid][pCrashed]);
            dini_IntSet(string, "Job", PlayerInfo[playerid][pJob]);
            dini_IntSet(string, "HouseEntered", HouseEntered[playerid]);
            dini_IntSet(string, "IntEntered", IntEntered[playerid]);
            dini_FloatSet(string, "CrashHealth",PlayerInfo[playerid][pCrashHealth]);
            dini_FloatSet(string, "CrashArmour",PlayerInfo[playerid][pCrashArmour]);
            dini_IntSet(string, "World", PlayerInfo[playerid][pWorld]);
            dini_IntSet(string, "PayCheck", PlayerInfo[playerid][pPayCheck]);
            dini_IntSet(string, "PayDay", PlayerInfo[playerid][pPayDay]);
            dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
            dini_IntSet(string, "ConnectTime", PlayerInfo[playerid][pConnectTime]);
            dini_IntSet(string, "DonateTime", PlayerInfo[playerid][pDonateTime]);
            dini_IntSet(string, "Jailed", PlayerInfo[playerid][pJailed]);
            dini_IntSet(string, "JailTime", PlayerInfo[playerid][pJailTime]);
            dini_IntSet(string, "Drugs", PlayerInfo[playerid][pDrugs]);
            dini_IntSet(string, "Materials", PlayerInfo[playerid][pMats]);
            dini_IntSet(string, "VaultOwned", PlayerInfo[playerid][pVaultOwned]);
            dini_IntSet(string, "VaultDrugs", PlayerInfo[playerid][pVaultDrugs]);
            dini_IntSet(string, "VaultMats", PlayerInfo[playerid][pVaultMats]);
            dini_IntSet(string, "Watch", PlayerInfo[playerid][pWatch]);
            dini_IntSet(string, "PhoneBook", PlayerInfo[playerid][pPhoneBook]);
            dini_IntSet(string, "Mask", PlayerInfo[playerid][pMask]);
            dini_IntSet(string, "CarLic", PlayerInfo[playerid][pDrivLic]);
            dini_IntSet(string, "Car", PlayerInfo[playerid][pCarkey]);
            dini_IntSet(string, "Car2", PlayerInfo[playerid][pCarkey2]);
            dini_IntSet(string, "Car3", PlayerInfo[playerid][pCarkey3]);
            dini_IntSet(string, "Married", PlayerInfo[playerid][pMarried]);
            dini_IntSet(string, "Tester", PlayerInfo[playerid][pTester]);
            dini_IntSet(string, "WantedLevel", WantedLevel[playerid]);
            dini_IntSet(string, "GunLic", PlayerInfo[playerid][pGunLic]);
            dini_IntSet(string, "Crimes", PlayerInfo[playerid][pCrimes]);
            dini_IntSet(string, "Arrested", PlayerInfo[playerid][pArrested]);
            dini_Set(string, "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
            dini_Set(string, "Taunt", PlayerInfo[playerid][pTaunt]);
            dini_IntSet(string, "DonateCarDate", PlayerInfo[playerid][pDonatorCarDate]);
            dini_IntSet(string, "Warrant", PlayerInfo[playerid][pWarrant]);
            dini_Set(string, "WarrantReason", PlayerInfo[playerid][pWarrantReason]);
            dini_IntSet(string, "FactionIdent", PlayerInfo[playerid][pFactionIden]);
            dini_IntSet(string, "LockTime", PlayerInfo[playerid][pLockTime]);
            dini_IntSet(string, "AltChar", PlayerInfo[playerid][pAltModel]);
            dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle];//==========LINE 9254==============
            dini_IntSet(string, "BeenWiped", 1);
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Unable to register, account exists.");
            Kick(playerid);
            return 1;
        }
    }
    return 1;
}
Line 9254
pawn Код:
dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle];
Reply
#2

Edited post , I accidently clicked the wrong button.
Reply
#3

Show me line 9254.

Tip: The compiler speaks pure English. All it is saying that it wanted to see a comma but found a semi colon so like wtf.
Reply
#4

@Tee Already edited the post, Look above
Reply
#5

Can I bump? Oh, I did.
Reply
#6

What comes before that? And is line 9254 "//Here" ?
Reply
#7

Jeez I guess I defined it well. But anyway
Look the end of this code :
pawn Код:
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string[128];

        format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));

        if(!dini_Exists(string))
        {
            dini_Create(string);
            dini_Set(string, "Key", password);
            dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
            dini_IntSet(string, "AdminJailCount", PlayerInfo[playerid][pAjailc]);
            dini_IntSet(string, "Account", PlayerInfo[playerid][pAccount]);
            dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
            dini_IntSet(string, "Level", PlayerInfo[playerid][pLevel]);
            dini_IntSet(string, "Respect", PlayerInfo[playerid][pExp]);
            dini_IntSet(string, "Arrive", PlayerInfo[playerid][pArrive]);
            dini_IntSet(string, "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
            dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
            dini_IntSet(string, "Gun1", PlayerInfo[playerid][pGun1]);
            dini_IntSet(string, "Gun2", PlayerInfo[playerid][pGun2]);
            dini_IntSet(string, "Gun3", PlayerInfo[playerid][pGun3]);
            dini_IntSet(string, "Gun4", PlayerInfo[playerid][pGun4]);
            dini_IntSet(string, "Gun5", PlayerInfo[playerid][pGun5]);
            dini_IntSet(string, "Gun6", PlayerInfo[playerid][pGun6]);
            dini_IntSet(string, "Gun7", PlayerInfo[playerid][pGun7]);
            dini_IntSet(string, "Gun8", PlayerInfo[playerid][pGun8]);
            dini_IntSet(string, "Gun9", PlayerInfo[playerid][pGun9]);
            dini_IntSet(string, "Gun10", PlayerInfo[playerid][pGun10]);
            dini_IntSet(string, "Gun11", PlayerInfo[playerid][pGun11]);
            dini_IntSet(string, "Gun12", PlayerInfo[playerid][pGun12]);
            dini_IntSet(string, "Gun13", PlayerInfo[playerid][pGun13]);
            dini_IntSet(string, "Ammo1", PlayerInfo[playerid][pAmmo1]);
            dini_IntSet(string, "Ammo2", PlayerInfo[playerid][pAmmo2]);
            dini_IntSet(string, "Ammo3", PlayerInfo[playerid][pAmmo3]);
            dini_IntSet(string, "Ammo4", PlayerInfo[playerid][pAmmo4]);
            dini_IntSet(string, "Ammo5", PlayerInfo[playerid][pAmmo5]);
            dini_IntSet(string, "Ammo6", PlayerInfo[playerid][pAmmo6]);
            dini_IntSet(string, "Ammo7", PlayerInfo[playerid][pAmmo7]);
            dini_IntSet(string, "Ammo8", PlayerInfo[playerid][pAmmo8]);
            dini_IntSet(string, "Ammo9", PlayerInfo[playerid][pAmmo9]);
            dini_IntSet(string, "Ammo10", PlayerInfo[playerid][pAmmo10]);
            dini_IntSet(string, "Ammo11", PlayerInfo[playerid][pAmmo11]);
            dini_IntSet(string, "Ammo12", PlayerInfo[playerid][pAmmo12]);
            dini_IntSet(string, "Ammo13", PlayerInfo[playerid][pAmmo13]);
            dini_FloatSet(string, "pSHealth", PlayerInfo[playerid][pSHealth]);
            dini_FloatSet(string, "Health", PlayerInfo[playerid][pHealth]);
            dini_FloatSet(string, "Pos_x", PlayerInfo[playerid][pPos_x]);
            dini_FloatSet(string, "Pos_y", PlayerInfo[playerid][pPos_y]);
            dini_FloatSet(string, "Pos_z", PlayerInfo[playerid][pPos_z]);
            dini_IntSet(string, "Int", PlayerInfo[playerid][pInt]);
            dini_IntSet(string, "Local", PlayerInfo[playerid][pLocal]);
            dini_IntSet(string, "Team", PlayerInfo[playerid][pTeam]);
            dini_IntSet(string, "Char", PlayerInfo[playerid][pModel]);
            dini_IntSet(string, "PhoneNr", PlayerInfo[playerid][pPnumber]);
            dini_IntSet(string, "House", PlayerInfo[playerid][pHousekey]);
            dini_IntSet(string, "Bizz", PlayerInfo[playerid][pPbiskey]);
            dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
            dini_IntSet(string, "FightSkill", PlayerInfo[playerid][pFightSkill]);
            dini_IntSet(string, "Sex", PlayerInfo[playerid][pSex]);
            dini_IntSet(string, "Age", PlayerInfo[playerid][pAge]);
            dini_IntSet(string, "Tutorial", PlayerInfo[playerid][pTut]);
            dini_IntSet(string, "Member", PlayerInfo[playerid][pMember]);
            dini_IntSet(string, "Rank", PlayerInfo[playerid][pRank]);
            dini_IntSet(string, "Crashed", PlayerInfo[playerid][pCrashed]);
            dini_IntSet(string, "Job", PlayerInfo[playerid][pJob]);
            dini_IntSet(string, "HouseEntered", HouseEntered[playerid]);
            dini_IntSet(string, "IntEntered", IntEntered[playerid]);
            dini_FloatSet(string, "CrashHealth",PlayerInfo[playerid][pCrashHealth]);
            dini_FloatSet(string, "CrashArmour",PlayerInfo[playerid][pCrashArmour]);
            dini_IntSet(string, "World", PlayerInfo[playerid][pWorld]);
            dini_IntSet(string, "PayCheck", PlayerInfo[playerid][pPayCheck]);
            dini_IntSet(string, "PayDay", PlayerInfo[playerid][pPayDay]);
            dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
            dini_IntSet(string, "ConnectTime", PlayerInfo[playerid][pConnectTime]);
            dini_IntSet(string, "DonateTime", PlayerInfo[playerid][pDonateTime]);
            dini_IntSet(string, "Jailed", PlayerInfo[playerid][pJailed]);
            dini_IntSet(string, "JailTime", PlayerInfo[playerid][pJailTime]);
            dini_IntSet(string, "Drugs", PlayerInfo[playerid][pDrugs]);
            dini_IntSet(string, "Materials", PlayerInfo[playerid][pMats]);
            dini_IntSet(string, "VaultOwned", PlayerInfo[playerid][pVaultOwned]);
            dini_IntSet(string, "VaultDrugs", PlayerInfo[playerid][pVaultDrugs]);
            dini_IntSet(string, "VaultMats", PlayerInfo[playerid][pVaultMats]);
            dini_IntSet(string, "Watch", PlayerInfo[playerid][pWatch]);
            dini_IntSet(string, "PhoneBook", PlayerInfo[playerid][pPhoneBook]);
            dini_IntSet(string, "Mask", PlayerInfo[playerid][pMask]);
            dini_IntSet(string, "CarLic", PlayerInfo[playerid][pDrivLic]);
            dini_IntSet(string, "Car", PlayerInfo[playerid][pCarkey]);
            dini_IntSet(string, "Car2", PlayerInfo[playerid][pCarkey2]);
            dini_IntSet(string, "Car3", PlayerInfo[playerid][pCarkey3]);
            dini_IntSet(string, "Married", PlayerInfo[playerid][pMarried]);
            dini_IntSet(string, "Tester", PlayerInfo[playerid][pTester]);
            dini_IntSet(string, "WantedLevel", WantedLevel[playerid]);
            dini_IntSet(string, "GunLic", PlayerInfo[playerid][pGunLic]);
            dini_IntSet(string, "Crimes", PlayerInfo[playerid][pCrimes]);
            dini_IntSet(string, "Arrested", PlayerInfo[playerid][pArrested]);
            dini_Set(string, "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
            dini_Set(string, "Taunt", PlayerInfo[playerid][pTaunt]);
            dini_IntSet(string, "DonateCarDate", PlayerInfo[playerid][pDonatorCarDate]);
            dini_IntSet(string, "Warrant", PlayerInfo[playerid][pWarrant]);
            dini_Set(string, "WarrantReason", PlayerInfo[playerid][pWarrantReason]);
            dini_IntSet(string, "FactionIdent", PlayerInfo[playerid][pFactionIden]);
            dini_IntSet(string, "LockTime", PlayerInfo[playerid][pLockTime]);
            dini_IntSet(string, "AltChar", PlayerInfo[playerid][pAltModel]);
            dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle];//==========LINE 9254==============
            dini_IntSet(string, "BeenWiped", 1);
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Unable to register, account exists.");
            Kick(playerid);
            return 1;
        }
    }
    return 1;
}
Again, just clearify -
pawn Код:
dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle];//==========LINE 9254==============
Reply
#8

Yea you showed me twice and you did not see that there was no closing braket. You are missing a braket.

pawn Код:
dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle]; //<-------------- No bracket.
pawn Код:
dini_IntSet(string, "FightingStyle", PlayerInfo[playerid][pFightingStyle];) //<--------------Bracket
Reply
#9

Oh hey thanks
Reply
#10

No problem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)