13.02.2017, 16:13
Hello, I was playing around with parameters,
As you can see I formatted adminname and adminid in message string, Now I want when someone use /sendtols playerid the one who get teleported by admin Gets the message "You have been teleported by Adminname[Adminid]" I know how to do this but my problem is how do I color adminname and adminid?
PHP код:
CMD:sendtols(playerid, params[])
{
new sendtolsplayerid;
if(sscanf(params, "u", sendtolsplayerid))
{
return SendClientMessage(playerid, COLOR_RED, "Usage: /sendtols [Playerid]");
}
if(sendtolsplayerid == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid, COLOR_RED, "You entered Invalid Player ID");
}
else
{
new adminname[MAX_PLAYER_NAME], adminid = playerid;
GetPlayerName(playerid, adminname, sizeof(adminname));
new message[24];
SetPlayerPos(sendtolsplayerid, 1521.5381, -1677.6841, 13.5469);
format(message,sizeof(message), "%s[%d]", adminname, adminid);
SendClientMessage(sendtolsplayerid, COLOR_WHITE, "You have been teleported by {b0fc2d}message");
}
return 1;
}