format(string, sizeof(string), "[MC] %s: %s " , sendername, result);
OOCOff(FBI_COLOR,string);
printf("%s", string);
|
Originally Posted by MadeMan
printf will show a message in server console not in game
|
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "[MC] %s: %s " , sendername, result);
OOCOff(LSPD_MAINCHAT,string);
printf("%s", string);
}
public OnPlayerText(playerid,text[])
{
new string[2][MAX_PLAYER_NAME];
GetPlayerName(playerid,string[0],sizeof(string[]));
GetPlayerName(playerid,string[1],sizeof(string[]));
format(string[0],sizeof(string[]),"[%d]%s",playerid,string[0]);
SetPlayerName(playerid,string[0]);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid,string[1]);
return 0;
}
|
Originally Posted by hehu
I saw your example, i can't find the color for orange, as the "Player_Name"
Код:
public OnPlayerText(playerid,text[])
{
new string[2][MAX_PLAYER_NAME];
GetPlayerName(playerid,string[0],sizeof(string[]));
GetPlayerName(playerid,string[1],sizeof(string[]));
format(string[0],sizeof(string[]),"[%d]%s",playerid,string[0]);
SetPlayerName(playerid,string[0]);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid,string[1]);
return 0;
}
|