[Help] Clan Chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Clan Chat (
/showthread.php?tid=162067)
[Help] Clan Chat -
Dudits - 22.07.2010
I've got dynamic clan system where people can create their own clan which appears in a [] tag.
Each clan created saves in a new .ini file with it's name (Just like players) in the "Clans" folder.
What I wanna do is getting a "/cc [text]" command that only appears for people in the clan of "playerid".
I've been trying to do this but well... I failed.
Note: A clan could have ANY name, it's set by the player via "/clan create" command.
I use this for detecting the player's clan "PlayerInfo[playerid][pClan]"
Can someone help
?
Re: [Help] Clan Chat -
bigcomfycouch - 22.07.2010
pawn Код:
CMD:cc(playerid, params[])
{
new text[128], string[128];
if(sscanf(params, "s", text)) return 1
format(string, 128, "[CLAN] %s: %s", RPN(playerid), text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || strcmp(PlayerInfo[playerid][pClan], PlayerInfo[i][pClan], true)) continue;
SendClientMessage(i, colour, text);
}
return 1;
}
Re: [Help] Clan Chat -
Dudits - 22.07.2010
Quote:
Originally Posted by bigcomfycouch
pawn Код:
CMD:cc(playerid, params[]) { new text[128], string[128]; if(sscanf(params, "s", text)) return 1 format(string, 128, "[CLAN] %s: %s", RPN(playerid), text); for(new i = 0; i < MAX_PLAYERS; i++) { if(!IsPlayerConnected(i) || strcmp(PlayerInfo[playerid][pClan], PlayerInfo[i][pClan], true)) continue; SendClientMessage(i, colour, text); } return 1; }
|
I can't really get it to work properly, I'll just try more with it.
Re: [Help] Clan Chat -
(SF)Noobanatior - 22.07.2010
is pclan a intger or a string? ie its the id of a players clan || a name "something"
Re: [Help] Clan Chat -
Dudits - 22.07.2010
pClan is a string