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


Messages In This Thread
How can I save this using Yini? - by Exhibit - 16.05.2018, 22:54
Re: How can I save this using Yini? - by GTLS - 17.05.2018, 04:30
Re: How can I save this using Yini? - by Exhibit - 17.05.2018, 11:06
Re: How can I save this using Yini? - by Lokii - 17.05.2018, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)