Y_INI Problem.
#1

Hello all!
I want some help with my function :
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Ban",1);
INI_WriteInt(File,"NomAdmin",PlayerName(playerid)) ;
INI_WriteInt(File,"RaisonBan",params);
INI_Close(File);

NomAdmin and RaisonBan don't work! I don't know why! There is an other function to write name and her reasons? Please help me.
Reply
#2

Show us your whole code, and when pasting code, use the code button, so it's readable.
Reply
#3

http://pastebin.com/w1nB5gUV
Warnings :
C:\Users\info\Desktop\LSC-RP\gamemodes\Beta.pwn(741) : error 035: argument type mismatch (argument 3)
C:\Users\info\Desktop\LSC-RP\gamemodes\Beta.pwn(742) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

can u tell in code which two line has this error?
Reply
#5

Why are you writing the player's name, and the ban reason to an integer? Use INI_WriteString for that!
Reply
#6

It works great! Thanks you very much! +rep
Reply
#7

Don't work InGame, there aren't the name and her reason, i don't know why.
Reply
#8

pawn Код:
COMMAND:ban(playerid, params[])
    {
        new id, string[268], raison[268];
        if(sscanf(params, "us[268]", id, raison)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /ban [id] [raison]");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "INFO : Vous n'кtes pas un administrateur.");
        format(string, sizeof(string), "{8DFFFF}[ADMIN] {AA33AA}L'administrateur %s a banni dйfinitivement %s pour : %s", PlayerName(playerid), PlayerName(id), raison);
            SendClientMessageToAll(-1, string);
        // PARTIE DE SAVE, IMPORTANTE.
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"data");
        INI_WriteInt(File,"Ban",1);
        INI_WriteInt(File,"NomAdmin",PlayerName(playerid));
        INI_WriteString(File,"RaisonBan",raison);
        INI_Close(File);
        SetTimerEx("Kicking", 1000, 0, "i", playerid);
        return 1;
    }
Reply
#9

@ProjectMan Why are you writing the name using WriteInt? The name isn't an integer!
Reply
#10

Lol!
Now, he is not saving the ban + the reason and administrator name..
the other command, is saving the ban only but not the name and reason! Help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)