SA-MP Forums Archive
[Help] Maybe a easy question for dini users - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Maybe a easy question for dini users (/showthread.php?tid=122377)



[Help] Maybe a easy question for dini users - Niixie - 21.01.2010

Hey, i have a little problem with some dini stuff.

I want it to save Admin name and Playername in a dini file, but when i ban myself it says my name is 14?

heres my scanf for the kick command
pawn Code:
if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Kick <ID / Part of name> <Reason>\"");
        else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "\t [Server]: Player not found");
        else if (id == playerid) SendClientMessage(playerid, 0xFF0000AA, "\t [Server]: You cannot ban yourself!");
        else
This is a quote from my script
pawn Code:
if(!fexist(KickLog))
            {
                dini_Create(KickLog);
                dini_IntSet(KickLog, "Kicked Users", dini_Int(KickLog, "Kicked Users")+1);
                dini_IntSet(KickLog, "Name", GetPlayerName(id, idname, sizeof(idname)));
    //          dini_IntSet(KickLog, "Reason", reason);
                dini_IntSet(KickLog, "Administrator", GetPlayerName(playerid, pname, sizeof(pname)));
                dini_IntSet(KickLog, "0----------", -0);
            }
and heres a quote from my kicklog
Code:
Name=14
Administrator=14
Why, how, who ?
it looks fine to me, and theres no errors?
(i just learned dini)


Re: [Help] Maybe a easy question for dini users - Joe Staff - 21.01.2010

You're using GetPlayerName wrong!
pawn Code:
new namestring[24];
GetPlayerName(0,namestring,24);
print(Player ID 0's name is %s",namestring);



Re: [Help] Maybe a easy question for dini users - Niixie - 21.01.2010

But, i want the id from the player that types the command, aka playerid. and i want it in a string, then i could do
Code:
GetPlayerName(playerid, string, 64);
or
Code:
GetPlayerName(playerid, string, sizeof(string));
?

You're using it wrong
https://sampwiki.blast.hk/wiki/GetPlayerName


EDIT

Anybody that can help me?