Macro Help
#1

Код:
#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;
}
Reply
#2

why using macro ?

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)