SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/05/2018, 10:54 PM   #1
Exhibit
Little Clucker
 
Join Date: Dec 2015
Location: The hallows of Death
Posts: 45
Reputation: 1
Default How can I save this using Yini?

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 Code:
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!
Exhibit is offline   Reply With Quote
Old 17/05/2018, 04:30 AM   #2
GTLS
Huge Clucker
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 472
Reputation: 68
Default Re: How can I save this using Yini?

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.
__________________

I don't help for rep. I help cuz I was helped in the past.
GTLS is offline   Reply With Quote
Old 17/05/2018, 11:06 AM   #3
Exhibit
Little Clucker
 
Join Date: Dec 2015
Location: The hallows of Death
Posts: 45
Reputation: 1
Default Re: How can I save this using Yini?

Quote:
Originally Posted by GTLS View Post
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.
Exhibit is offline   Reply With Quote
Old 17/05/2018, 11:09 AM   #4
Lokii
Big Clucker
 
Join Date: Sep 2017
Posts: 113
Reputation: 59
Default Re: How can I save this using Yini?

Quote:
Originally Posted by Exhibit View Post
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
Lokii is offline   Reply With Quote
Old 17/05/2018, 11:38 AM   #5
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,665
Reputation: 3061
Default Re: How can I save this using Yini?

Quote:
Originally Posted by Exhibit View Post
There aren't any forum tutorials of a Dynamic Yini Clan/Faction/Group system.
Because "y_ini" (not "Yini") is a file system. You give it data, it saves that data. It has no concept of clans or factions - if you want those, use "y_groups". Any y_ini tutorial covers how to read and write data, it is up to you to decide what data you want to read and write, they can't really help you with that.
Y_Less is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IP Wont save, YINI Pawnify Scripting Help 6 11/07/2015 08:01 PM
Save timer minutes remaining YINI? HenrySunseri Scripting Help 2 10/03/2014 09:05 AM
[HELP]: YINI doesn't save Admin Level! Areax Scripting Help 2 08/09/2013 09:14 AM
[FilterScript] Teleport Maker [YINI] Save/Load [0.3x] JaKe Elite Filterscripts 5 12/08/2013 09:37 PM
save system yini Gangasta300 Scripting Help 4 09/04/2013 01:07 PM


All times are GMT. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.