SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/05/2018, 11:54 PM   #1
Exhibit
Big Clucker
 
Join Date: Dec 2015
Location: Basement.
Posts: 168
Reputation: 19
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, 05:30 AM   #2
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 878
Reputation: 92
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.


Some thing for ya. Click em
Basic House System

Simple Speedo

Retired from SAMP Scene. Might open SAMP Forums once in a while.
GTLS is offline   Reply With Quote
Old 17/05/2018, 12:06 PM   #3
Exhibit
Big Clucker
 
Join Date: Dec 2015
Location: Basement.
Posts: 168
Reputation: 19
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, 12:09 PM   #4
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 281
Reputation: 72
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, 12:38 PM   #5
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,307
Reputation: 3191
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 offline   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 7 23/07/2018 09:44 PM
Save timer minutes remaining YINI? HenrySunseri Scripting Help 2 10/03/2014 10:05 AM
[HELP]: YINI doesn't save Admin Level! Areax Scripting Help 2 08/09/2013 10:14 AM
[FilterScript] Teleport Maker [YINI] Save/Load [0.3x] JaKe Elite Filterscripts 5 12/08/2013 10:37 PM
save system yini Gangasta300 Scripting Help 4 09/04/2013 02:07 PM


All times are GMT. The time now is 11:01 AM.


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