Help me
#1

Hi, I am using this y_ini Login / Register, and I'm using this enum:
Код:
enum pInfo
{
    pSifra,
    pNovac,
    pAdmin,
    pSmrti,
    pUbistva,
    pBankaNovac,
    pKikovan,
    pPosao,
    pDroga,
    pPrivatnoImanje,
    pLevel,
    pSIme[MAX_PLAYER_NAME]
}
How can I make the "pSIme" line store strings inside it, so in the txt file it looks like SIme = text?
If any more explanation needed, ask.
Reply
#2

Nobody?
Reply
#3

Replace
Код:
PSima[MAX_PLAYER_NAME] with PSima[MAX_PLAYER_NAME + 1]
Use it with:
Код:
GetPlayerName(playerid, PlayerInfo[playerid][PSima], MAX_PLAYER_NAME + 1);
Reply
#4

Okay, I understand what you mean, I don't know how to explain this, I made a command to change a player's name and here it is:
Код:
CMD:specijalnoime(playerid, params[], help)
{
	JeliLogovan
	if(PlayerInfo[playerid][pAdmin] < 6) return NematePravo
	if(AdminDuznost[playerid] == 0) return NisteAD
	new id, ime[MAX_PLAYER_NAME], msg1[128], msg2[128], msg3[128];
	if(sscanf(params, "us[16]", id, ime)) return SCM, "[ E ] | {FFFFFF}Koristenje: /promjeniime {ffdf2d}[ID] [IME].");
	else
	{
		if(id == INVALID_PLAYER_ID) return NemaIgraca
		PlayerInfo[id][pSIme] = ime;
		SetPlayerName(id, ime);
		format(msg1, sizeof(msg1), "[ E ] | {FFFFFF}Igracu {ffdf2d}%s {ffffff}ste postavili specijalno ime na {ffdf2d}%s.", ImeIgraca(id), ime);
		format(msg2, sizeof(msg2), "[ E ] | {FFFFFF}Vlasnik {ffdf2d}%s {ffffff}vam je postavio specijalno ime na {ffdf2d}%s.", ImeIgraca(playerid), ime);	
		format(msg3, sizeof(msg3), "[ E ] | {FFFFFF}Svaki put kada ulazite na server, koristite ime {ffdf2d}%s, {ffffff}server ce vam automatski postaviti specijalno ime.", ImeIgraca(id));
		SendClientMessage(playerid, ZUTA, msg1);
		SendClientMessage(id, ZUTA, msg2);
		SendClientMessage(id, ZUTA, msg3);
	}
	return 1;
}
But I also made this:
Код:
public OnPlayerConnect(playerid, classid)
{
	if(PlayerInfo[playerid][pSIme] != 0)
	{
		SetPlayerName(playerid, PlayerInfo[playerid][pSIme]);
	}
	else
	{
		new string[200];
		new namestring = strfind(ImeIgraca(playerid), "_", true);
		if(namestring == -1)
		{
			SCM, "[ E ] | {FFFFFF}Kikovani ste sa servera zbog NON-RP imena. Ime mora biti u formatu Ime_Prezime, naprimjer Marko_Markovic.");
			format(string, sizeof(string),"[ E ] | {FFFFFF}Igrac %s nije koristio RP ime i zbog toga je kikovan sa servera.", ImeIgraca(playerid));
			SCMTA(ZUTA, string);
			SetTimerEx("ImeKick", 500, false, "i", playerid);
			return 1;
		}
	}
     return 1;
}
When I do the command, it works, the player's name changes and everything, but in the INI file, it says pSIme = 69. I hope you understand what I wanted to do here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)