[id] before [name]
#1

hello i want add player [id] before the name

pealse copy it then replay with correct fix
>>



public OnPlayerText(playerid, text[])
{
if(ServerInfo[AntiAdv] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
{
new strR[255];
new is1=0;
new r=0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1;
new p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
else
{
strmid(strR[r],text,is1,is2,255);
if(strval(strR[r])<255) r++;
is1=is2;
p=1;
}
}
}
is1++;
}
if(r>=4)
{
new STRname[255];
GetPlayerName(playerid,STRname,255);
for(new j1=0; j1 < MAX_PLAYERS;j1++)
for(new z=0;z<r;z++)
{
new pr2;
while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
Kick(playerid);
}
}
}
if(IsIPInText(text)) {
SendClientMessage(playerid,RED,"You are not allowed to use IP adresses in your chat!");
return 1;
}
if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1) {
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH," Says: %s",text);
SetPlayerChatBubble(playerid,to_others,MESSAGE_COL OR,35.0,10000);
return 0;
}
if(text[0] == '!') {
new gangChat[128];
new senderName[MAX_PLAYER_NAME];
new string[128];
strmid(gangChat,text,1,strlen(text));
GetPlayerName(playerid, senderName, sizeof(senderName));
format(string, sizeof(string)," %s: %s", senderName, gangChat);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(PlayerInfo[i][team] == PlayerInfo[playerid][team]) {
SendClientMessage(i, COLOR_YELLOW, string);
}
}
return 0;
}
for(new i = 1; i < MAX_CHAT_LINES-1; i++) Chat[i] = Chat[i+1];
new ChatSTR[128]; GetPlayerName(playerid,ChatSTR,sizeof(ChatSTR)); format(ChatSTR,128," [lchat]%s: %s",ChatSTR, text[0] );
Chat[MAX_CHAT_LINES-1] = ChatSTR;
if(PlayerInfo[playerid][Caps] == 1) UpperToLower(text);
if(ServerInfo[NoCaps] == 1) UpperToLower(text);
if(ServerInfo[DisableChat] == 1) {
SendClientMessage(playerid,red,"Chat has been disabled");
return 0;
}
if(PlayerInfo[playerid][Muted] == 1)
{
PlayerInfo[playerid][MuteWarnings]++;
new string[128];
if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked. (%d / %d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
SendClientMessage(playerid,red,string);
} else {
SendClientMessage(playerid,red,"You have been warned ! Now you have been kicked");
format(string, sizeof(string),"***%s (ID %d) was kicked for exceeding mute warnings", PlayerName2(playerid), playerid);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(playerid);
}
return 0;
}

if(ServerInfo[AntiSpam] == 1 && (PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) )
{
if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();

PlayerInfo[playerid][SpamCount]++;
if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIMELIMIT) { // Its OK your messages were far enough apart
PlayerInfo[playerid][SpamCount] = 0;
PlayerInfo[playerid][SpamTime] = TimeStamp();
}
else if(PlayerInfo[playerid][SpamCount] == SPAM_MAX_MSGS) {
new string[64]; format(string,sizeof(string),"%s has been kicked (Flood/Spam Protection)", PlayerName2(playerid));
SendClientMessageToAll(grey,string); print(string);
SaveToFile("KickLog",string);
Kick(playerid);
}
else if(PlayerInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1) {
SendClientMessage(playerid,red,"Anti Spam Warning! Next is a kick.");
return 0;
}
}
if(ServerInfo[AntiSwear] == 1 && PlayerInfo[playerid][Level] < ServerInfo[MaxAdminLevel])
for(new s = 0; s < ForbiddenWordCount; s++)
{
new pos;
while((pos = strfind(text,ForbiddenWords[s],true)) != -1) for(new i = pos, j = pos + strlen(ForbiddenWords[s]); i < j; i++) text[i] = '*';
}
if (Calling[playerid] > -1 && Answered[playerid] == 1)
{
new string[128];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s: %s", sendername, text);
SendClientMessage(Calling[playerid], COLOR_YELLOW, string);
format(string, sizeof(string), " %s: %s", sendername, text);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s: %s", sendername, text);
print(string);
format(string, sizeof(string), " %s: %s", sendername, text);
print(string);
return 0;
}
else
{
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH," Says: %s",text);
SetPlayerChatBubble(playerid,to_others,MESSAGE_COL OR,35.0,10000);
}
return 1;
}
new gatez1;
Reply
#2

with php balise
Reply
#3

what mean {with php balise
}?
Reply
#4

thx lida i will try it now
Reply
#5

it's not work too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)