How can I save this using Yini?
#1

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.
PHP код:
CMD:createclan(playeridparams[])
{
    new 
string[64], clanname[64];
    if(
Spawned[playerid] == 0) return SendClientMessage(playeridCOLOR_ERROR"Error: You are not spawned.");
    if(
sscanf(params"s"clanname)) return SendClientMessage(playeridCOLOR_GRAY"Usage: /createclan [name]");
    if(
GetPlayerScore(playerid) < 300) return SendClientMessage(playeridCOLOR_ERROR"Error: You must have 300 score in order to make a clan");
    if(
GetPlayerCash(playerid) < 80000) return SendClientMessage(playeridCOLOR_ERROR"Error: You must have atleast $80,000 in order to make a clan");
    if(
strlen(clanname) > 64 || strlen(clanname) < 1) return SendClientMessage(playeridCOLOR_ERROR"Error: Clan name must be less than 64 characters and more than 1 character.");
    if(
PlayerClan[playerid] > 0) return SendClientMessage(playeridCOLOR_ERROR"Error: You are already in a clan!");
    for(new 
1MAX_CLANSi++) {
    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(stringsizeof(string),"You've created clan '%s' (ID: %d)"ClanNames[i], i);
       
SendClientMessage(playerid, -1string);
           
PlayerClan[playerid]=i;
       break; }
    }
    
SetPlayerCash(playeridGetPlayerCash(playerid) - 80000);
    return 
1;

Thanks!
Reply
#2

You will save your Clans insided your clan folder just the same way you'd save your player accounts. Search forum for a tutorial of YINI if you dont know how to do it.
Reply
#3

Quote:
Originally Posted by GTLS
Посмотреть сообщение
You will save your Clans insided your clan folder just the same way you'd save your player accounts. Search forum for a tutorial of YINI if you dont know how to do it.
There aren't any forum tutorials of a Dynamic Yini Clan/Faction/Group system.
Reply
#4

Quote:
Originally Posted by Exhibit
Посмотреть сообщение
There aren't any forum tutorials of a Dynamic Yini Clan/Faction/Group system.
Learn y_ini and then you will know how to make it or even better learn sqlite or mysql
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)