19.07.2015, 09:31
i need chat tag like [BSS]sami_zaidi any one can help me
new bool:TagStatus[MAX_PLAYERS];//global
if(!strcmp(cmdtext,"/bsstag",true))//OnPlayerCommandText
{
TagStatus[playerid] = !TagStatus[playerid];
return 1;
}
//OnPlayerText
new string[145],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof name);
if(TagStatus[playerid] == true)format(string,sizeof string,"[BSS]%s: %s",name,text);
else format(string,sizeof string,"%s: %s",name,text);
new bool:isTagged[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
new pname[24];
GetPlayerName(playerid,pname,sizeof(pname));
if (strcmp("/bsstag", cmdtext, true, 10) == 0)
{
if(isTagged[playerid] == false)
{
isTagged[playerid] = true;
}
return 1;
}
return 0;
}
public OnPlayerText(playerid, text[])
{
public OnPlayerText(playerid, text[])
{
new pText[144];
if(IsTagged[playerid] == true)
{
format(pText, sizeof (pText), "[TAG]%s", pname, text);
SendPlayerMessageToAll(playerid, pText);
}
return 0;
}
if(isTagged[playerid] == false)
{
isTagged[vehicleid] = true;
}
@KillerDVX:
What are you doing there? PHP код:
When you want to help other people you should send a correct code or explain this with a text and without code. - Mencent |