clan chating with the same tag
#1

_removed_
Reply
#2

Yes. You can put that under OnPlayerText.

> Check whether the first character in the sentence is a dollar sign:
PHP код:
if(text[0] == '$'
> If it is, then send the message to every connected player THAT is in the same clan:
PHP код:
for(new 0GetPlayerPoolSize(); <= j++) // When you're not using foreach or y_iterate 
PHP код:
foreach(new Player// when you are using foreach or y_iterate 
PHP код:
{
    
// This is inside the for-loop or inside foreach
    
if(pInfo[i][Clan] == pInfo[playerid][Clan]) { // Change these variables to the ones you have
        
        // The player with ID equal to the current loop index is in the same clan as the player sending the message
        
SendClientMessage(i, -1text[1]); 
       
// You don't want to send the dollar sign along with the message, thus start sending the message from the second character. Array indexes start counting from 0 and not from 1!
        
return 0// Cancel sending the message to global chat
    
}

And if you want to compare names and check if the tags are equal, then use strcmp():
PHP код:
if(strcmp(tagtargetnamefalsestrlen(tag)) == 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)