[Help] Maybe a easy question for dini users
#1

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)
Reply
#2

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)