SA-MP Forums Archive
SetPlayerName help! - 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)
+--- Thread: SetPlayerName help! (/showthread.php?tid=640988)



SetPlayerName help! - AmarPlayer - 09.09.2017

Hi! I need help with this:
Код:
CMD:specijalnoime(playerid, params[], help)
{
	JeliLogovan
	if(PlayerInfo[playerid][pAdmin] < 6) return NematePravo
	if(AdminDuznost[playerid] == 0) return NisteAD
	new id, ime, 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;
}
I get an error at the line "SetPlayerName(id, ime);" saying argument type mismatch (argument 2).
Now, I know what's my mistake, but how else should i write it?


Re: SetPlayerName help! - n00blek - 09.09.2017

new name[MAX_PLAYER_NAME],
SetPlayerName(playerid, name);


Re: SetPlayerName help! - AmarPlayer - 09.09.2017

OMG how didn't I notice that, I can't believe... Thank you :P


Re: SetPlayerName help! - n00blek - 09.09.2017

no problem


Re: SetPlayerName help! - AmarPlayer - 09.09.2017

Now I get the error must be assigned to an array
at the line:
Код:
PlayerInfo[id][pSIme] = ime;



Re: SetPlayerName help! - Kane - 09.09.2017

pSime needs to be a string.