04.08.2016, 17:44
You can use the function strcat to add the clan tag until check if the player is online.
Example:
I make a function to seach by string playername:
Then you can use
Note: Function IsPlayerConnected only accept playerid in params not string.
Example:
PHP код:
new clantag[40] = "[LOK]";
strcat(clantag, GetPName(playerto));
PHP код:
forward PlayerIsConnectedS(string[]);
public PlayerIsConnectedS(string[])
{
new nombre[MAX_PLAYER_NAME];
for(new i=0;i<GetPlayerPoolSize();i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
GetPlayerName(i, nombre, sizeof(nombre));
if(!strcmp(nombre, string))
return true;
}
}
return false;
}
PHP код:
if(!PlayerIsConnectedS(clantag)) return SendClientMessage(playerid, COLOR_WHITE1,"The player not connected.");