Not imputing the text
#1

I have this code:
pawn Код:
CreateDynamicFaction(iFac)
{
    new Filename[64], line[256];
    format(Filename, sizeof(Filename), FACTION_SYSTEM_File_PATH "Factions.ini");
    new File:handle = fopen(Filename, io_write);

    format(line, sizeof(line), "Faction Name=%s\r\n", arrFaction[iFac][g_szFactionName]); fwrite(handle, line);
    format(line, sizeof(line), "Faction ID=%i\r\n", arrFaction[iFac][g_iFactionID] = iFac); fwrite(handle, line);
    format(line, sizeof(line), "Locker VW=%d\r\n", arrFaction[iFac][g_iLockerVW]); fwrite(handle, line);
    format(line, sizeof(line), "Faction Type=%d\r\n", arrFaction[iFac][g_iFactionType]); fwrite(handle, line);
    format(line, sizeof(line), "Locker Guns=%i\r\n", arrFaction[iFac][g_iLockerGuns]); fwrite(handle, line);
    format(line, sizeof(line), "Locker Costing=%i\r\n", arrFaction[iFac][g_iLockerCost]); fwrite(handle, line);
    format(line, sizeof(line), "Allegiance=%d\r\n", arrFaction[iFac][g_iAllegiance]); fwrite(handle, line);
    format(line, sizeof(line), "Radio Access=%d\r\n", arrFaction[iFac][g_iRadioAccess]); fwrite(handle, line);
    format(line, sizeof(line), "Locker Stock=%i\r\n", arrFaction[iFac][g_iLockerStock]);
    format(line, sizeof(line), "--------------------------------");
    fwrite(handle, line);
    fclose(handle);
}
and on my Factions.cfg file it says this:

Quote:

0|1|84|||0.000000|0.000000|0.000000|0.000000|0.000 000|0.000000|0.000000|0.000000|0|0|0|0|$0|0

the '84' is a post to be the name but it says those random numbers instead

CMD to create a faction:
Quote:

CMD:createfaction(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 4) {

new
iFac = getFreeFaction(), amount, weapons, string[128];

if(iFac == -1) {
return SendClientMessage(playerid, -1, "There is too many factions.");
}

if(sscanf(params, "s[64]d", arrFaction[iFac][g_szFactionName], amount, weapons)) {
return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /createfaction [name] [type(/factypes)]");
}

format(string, sizeof(string), "You have created a faction called %s, faction ID %i & type %d has been assigned to it!", arrFaction[iFac][g_szFactionName], iFac, amount);

arrFaction[iFac][g_iFactionType] = amount;
SendClientMessageEx(playerid, COLOR_WHITE, string);
CreateDynamicFaction(iFac);
SaveDynamicFaction();
format(string, sizeof(string), "FACTION: %s has created a facton called %s, ID %i, type %i.", GetPlayerNameEx(playerid), arrFaction[iFac][g_szFactionName], iFac, amount);
Log("logs/factions.log", string);
}
return 1;
}

Reply
#2

Could you stop coming here with every problem what you have? Its a tenth topic which i replying you. If you want to create a Gamemode then learn some scripting basics then go and do a RolePlay GM. I don't know why you're started of doing this GameMode.. that's a hard way of the first project.

By the way, show where you saving this code.
Reply
#3

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Could you stop coming here with every problem what you have? Its a tenth topic which i replying you. If you want to create a Gamemode then learn some scripting basics then go and do a RolePlay GM. I don't know why you're started of doing this GameMode.. that's a hard way of the first project.

By the way, show where you saving this code.
Don't reply then, simple as that?

LOL.

I appreciate your help, I have been working on this game-mode for months. Its just im not good with dynamic things, sorry for posting threads asking for help.

pawn Код:
SaveDynamicFaction() {

    new
        szFileStr[1024],
        File: fHandle = fopen("Factions/Factions.cfg", io_write);

    for(new iIndex; iIndex < MAX_GROUPS; iIndex++) {
        format(szFileStr, sizeof(szFileStr), "%i|%i|%d|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|$%i|%d\r\n",
            arrFaction[iIndex][g_iFactionID],
            arrFaction[iIndex][g_iFactionType],
            arrFaction[iIndex][g_szFactionName],
            arrFaction[iIndex][g_iLockerGuns],
            arrFaction[iIndex][g_iLockerCost],
            arrFaction[iIndex][g_iAllegiance],
            arrFaction[iIndex][g_iBugAccess],
            arrFaction[iIndex][g_iChatAccess],
            arrFaction[iIndex][g_iRadioAccess],
            arrFaction[iIndex][g_iDeptRadioAccess],
            arrFaction[iIndex][g_hDutyColour],
            arrFaction[iIndex][g_hRadioColour],
            arrFaction[iIndex][g_iShareAssets],
            arrFaction[iIndex][g_iLockerStock],
            arrFaction[iIndex][g_fLockerPos],
            arrFaction[iIndex][g_iLockerVW],
            arrFaction[iIndex][g_fCratePos],
            arrFaction[iIndex][g_iFacVault],
            arrFaction[iIndex][g_t3DLabels]
        );
        fwrite(fHandle, szFileStr);
    }
    fclose(fHandle);
    return 1;
}
Reply
#4

Just throwing this out there, the NGRP script is NOT a good gamemode for beginners. Unless of course you feel like breaking your brain.
Reply
#5

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Just throwing this out there, the NGRP script is NOT a good gamemode for beginners. Unless of course you feel like breaking your brain.
Its funny because, its not even NGRP.

Its a basic role-play GM that was released on the forums, its helping me learn so are people on the forums that are willing to help me.

Reply
#6

Why you should not use 256 arrays
https://sampwiki.blast.hk/wiki/File_Functions
https://sampwiki.blast.hk/wiki/Strcat

You didn't get that what i said.. when you're a beginner you should not starting creating a RP/GF gamemode type. It's too hard on the start. You SHOULD think about some type of Deathmatch or Team Deatchmatch. By the way read the above links.
Reply
#7

Can anyone atchually help me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)