need help with dini - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with dini (
/showthread.php?tid=248797)
need help with dini -
fissekarl - 15.04.2011
Hello,
this doesnt create a file with the clan name
pawn Код:
COMMAND:createclan(playerid, params[])
{
new string[128], tag[10], type, Name[24], pName[MAX_PLAYER_NAME], file[128];
if (sscanf(params, "is[10]s[24]", type, tag, Name)) return SendClientMessage(playerid, Yellow, "Usage: /createclan [1 (start) / 2 (end)] [tag], do not include [ or ] in the tag, clan-name");
GetPlayerName(playerid, Name, sizeof(Name));
format(file, sizeof(file), "Clans/%s", Name);
for(new i = 0; i < sizeof(ClanInfo); i++) {
switch (type)
{
case 1:
{
ClanInfo[i][cFront] = 1;
format(string,sizeof(string),"You have created the clan [%s], at the front of your name",tag);
SendClientMessage(playerid,Green,string);
GetPlayerName(playerid, pName, sizeof(pName));
dini_Set(file, "cName", Name);
dini_Set(file, "Tag", tag);
dini_Set(file, "Owner", pName);
dini_IntSet(file, "Front", 1);
return 1;
}
case 2:
{
ClanInfo[i][cBack] = 1;
format(string,sizeof(string),"You have created the clan [%s], at the front of your name",tag);
SendClientMessage(playerid,Green,string);
GetPlayerName(playerid, pName, sizeof(pName));
dini_Set(file, "cName", Name);
dini_Set(file, "Tag", tag);
dini_Set(file, "Owner", pName);
dini_IntSet(file, "Back", 1);
return 1;
}
default:
{
SendClientMessage(playerid, Yellow, "Usage: /createclan [1 (start) / 2 (end)] [tag], do not include [ or ] in the tag, clan-name");
}
}
}
return 1;
}
Please help
Re: need help with dini -
admantis - 15.04.2011
You are setting data in a file that does not exist!
Re: need help with dini -
fissekarl - 15.04.2011
Okay works perfectly fine now
But, can you help me continue this code?
How can I make an clanID to each clan?
Example if player1 creates a clan he gets clan id 1
player2 gets clan id 2 , etc?
Re: need help with dini -
fissekarl - 16.04.2011
bump
Re: need help with dini -
fissekarl - 16.04.2011
I tried to make a clans cmds
pawn Код:
COMMAND:clans(playerid, params[])
{
new string[128];
format(string,sizeof(string),"Clan ID: %d - Clan Name: %s. Tag: [%s]", ClanInfo[cID], ClanInfo[cName], ClanInfo[cTag]);
SendClientMessage(playerid,-1,string);
return 1;
}
But nothing is shown?
Re: need help with dini -
fissekarl - 17.04.2011
Bump
Re: need help with dini -
fissekarl - 17.04.2011
bump