16.05.2018, 22:54
Title says it all. I want a separate folder name Clans and I want all the clans saved with their ids. How can I do this?
here is the command.
Thanks!
here is the command.
PHP код:
CMD:createclan(playerid, params[])
{
new string[64], clanname[64];
if(Spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Error: You are not spawned.");
if(sscanf(params, "s", clanname)) return SendClientMessage(playerid, COLOR_GRAY, "Usage: /createclan [name]");
if(GetPlayerScore(playerid) < 300) return SendClientMessage(playerid, COLOR_ERROR, "Error: You must have 300 score in order to make a clan");
if(GetPlayerCash(playerid) < 80000) return SendClientMessage(playerid, COLOR_ERROR, "Error: You must have atleast $80,000 in order to make a clan");
if(strlen(clanname) > 64 || strlen(clanname) < 1) return SendClientMessage(playerid, COLOR_ERROR, "Error: Clan name must be less than 64 characters and more than 1 character.");
if(PlayerClan[playerid] > 0) return SendClientMessage(playerid, COLOR_ERROR, "Error: You are already in a clan!");
for(new i = 1; i < MAX_CLANS; i++) {
if(ClanInfo[i][0]==0)
{
format(ClanNames[i], MAX_CLAN_NAME, "%s", clanname);
ClanInfo[i][0]=1;
ClanInfo[i][1]=1;
ClanMembers[i][0] = playerid;
format(string, sizeof(string),"You've created clan '%s' (ID: %d)", ClanNames[i], i);
SendClientMessage(playerid, -1, string);
PlayerClan[playerid]=i;
break; }
}
SetPlayerCash(playerid, GetPlayerCash(playerid) - 80000);
return 1;
}