Clan system help
#1

So im trying to make a clan system but im new into scripting so i kind of have no ideea how to make an advanced one.What i got so far is /cinvite and /acceptcinvite(the invite and accept invite for the clan) and i also have the "Buy Clan" option in the premium points shop.So my question is this,how do i take this system to the next step,like how do i ask the player to enter a name to the clan and how do i make a clan chat that is for every clan,because what i have scripted so far is like a common clan and if i make a clan chat everyone that is in a clan will speak on the same chat,i mean its only a clan there aren't more of them,i don't know if you understand me,you dont have to script the whole system,just give me some advice.

case 2:
{ // clan system buy clan
new string[128];
if(PlayerInfo[playerid][pClanMember] == 1) return SendClientMessage(playerid, COLOR_GREY, "You need to leave your clan before buying one");
if(PlayerInfo[playerid][pPremiumPoints] < 500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough premium points");
PlayerInfo[playerid][pClanRank] = 7;
PlayerInfo[playerid][pClanMember] = 1;
PlayerInfo[playerid][pPremiumPoints] -= 500;
format(string, sizeof(string), "Congratulations %s,you are now the proud owner of a clan",GetName(playerid));
SendClientMessage(playerid, COLOR_YELLOW, string);
UpdateVariable(playerid, pClanRankx);
UpdateVariable(playerid, pClanMemberx);
UpdateVariable(playerid, pPremiumPointsx);
}

CMD:cinvite(playerid, params[])
{
new targetid,string[128],string2[128];
if(PlayerInfo[playerid][pClanMember] == 0) return SendClientMessage(playerid, COLOR_GREY, "Nu faci parte dintr-un clan");
if(PlayerInfo[playerid][pClanRank] < 5) return SendClientMessage(playerid, COLOR_GREY, "Nu ai rank 5 in clan");
if(sscanf(params,"i", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE:{FFFFFF}/cinvite <playerid>");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat");
if(GetDistanceBetweenPlayers(playerid, targetid) > 4) return SendClientMessage(playerid, COLOR_GREY,"Trebuie sa te afli langa playerul respectiv");
if(PlayerInfo[targetid][pClanMember] == 1) return SendClientMessage(playerid, COLOR_GREY,"Acel player face deja parte dintr-un clan");
PlayerInfo[playerid][pClanInvite] = 1;
format(string,sizeof(string),"%s(%d) te-a invitat sa faci parte din clanul lui",GetName(playerid),playerid);
format(string2,sizeof(string2),"L-ai invitat pe %s(%d) sa faca parte din clanul tau",GetName(targetid),targetid);
SendClientMessage(playerid, COLOR_GREEN2, string2);
SendClientMessage(targetid, -1, string);
return 1;
}

CMD:acceptcinvite(playerid,params[])
{
new sender,string[128],string2[128];
if(PlayerInfo[playerid][pClanInvite] == 0) return SendClientMessage(playerid, COLOR_GREY, "You didn't recive a clan invitation");
if(sscanf(params,"i",sender)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/acceptcinvite <playerid>");
if(!IsPlayerConnected(sender)) return SendClientMessage(playerid, COLOR_GREY, "That player is not conencted");
if(GetDistanceBetweenPlayers(playerid, sender) > 4) return SendClientMessage(playerid, COLOR_GREY,"You need to be near that player");
PlayerInfo[playerid][pClanInvite] = 0;
PlayerInfo[playerid][pClanMember] = 1;
PlayerInfo[playerid][pClanRank] = 1;
format(string, sizeof(string),"You accepted the clan invite from %s",GetName(sender));
SendClientMessage(playerid, COLOR_GREEN2, string);
format(string2, sizeof(string), "%s accepted your clan invite",GetName(sender));
SendClientMessage(sender,-1, string2);
UpdateVariable(playerid, pClanMemberx);
UpdateVariable(playerid, pClanRankx);
return 1;
}
Reply


Messages In This Thread
Clan system help - by bosmania - 25.02.2019, 13:40

Forum Jump:


Users browsing this thread: 1 Guest(s)