04.07.2016, 21:34
pawn Код:
// ** INCLUDES
#include <a_samp>
#include <sscanf>
#include <zcmd>
// ** MAIN
main()
{
print("Loaded \"color_hex_function.amx\".");
}
// ** CALLBACKS
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
// ** COMMANDS
CMD:color(playerid, params[])
{
Function(playerid, "0xFFF000FF", "0xFF0000FF");
return 1;
}
// ** FUNCTIONS
stock Function(playerid, color_1[], color_2[])
{
new string[144];
format(string, sizeof(string), "{%06x}Hello {%06x}World!", HexToInt(color_1) >>> 8, HexToInt(color_2) >>> 8);
SendClientMessage(playerid, -1, string);
return 1;
}
stock HexToInt(hex[])
{
new int;
sscanf(hex, "x", int);
return int;
}

