SA-MP Forums Archive
Macro 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: Macro Help (/showthread.php?tid=571392)



Macro Help - RaeF - 18.04.2015

Код:
#define lib_GetPlayerName(%0,%1) \
	(%1 == true) ? (g_lib_core_[%0][E_LIB_CORE_USERNAME_WITH]) : (g_lib_core_[%0][E_LIB_CORE_USERNAME_NONE])

#if defined _ALS_GetPlayerName
	#undef GetPlayerName
#else
	#define _ALS_GetPlayerName
#endif
#define GetPlayerName lib_GetPlayerName
When i use it:

SimplifiedRoleplay.pwn(61) : warning 205: redundant code: constant expression is zero
SimplifiedRoleplay.pwn(61) : error 035: argument type mismatch (argument 1)
Код:
public OnPlayerDisconnect(playerid, reason)
{
	print(GetPlayerName(playerid, false));
	return 1;
}



Re: Macro Help - Azula - 18.04.2015

why using macro ?

PHP код:
new s[30];
format(s,s,"%s",GetPlayerName(playeridfalse)) );
print(
s); 



Re: Macro Help - RaeF - 18.04.2015

because that was efficient way, i had been do this before but i'm forget how it works

edit:

btw, you aren't fix anything with that . . .