Clanconfig.txt
#1

okay i've clanwar gamemode that detect clantag(names) from ClanConfig.txt in script files
is there anyway to change the team names by in game command?
Reply
#2

EDIT: That sounded cheeky.

Rephrased: Please post the code you need help with.
Reply
#3

okay this is it

Код:
rConfig()
{
	new File:fhandle;
	new cname[256];
	new temp[256];
	new value[256];
	fhandle = fopen("ClanConfig.txt",io_readwrite);
	while(fread(fhandle,temp,sizeof(temp),false))
	{
		cname = strtok(temp,0);
		value = strtok(temp,(strlen(cname)+1));

		if(strcmp(cname,"Team-1",true) == 0) strins(TEAM1,value,0,MAX_STRING);
		else if(strcmp(cname,"Team-2",true) == 0) strins(TEAM2,value,0,MAX_STRING);
		else if(strcmp(cname,"Max-Clan-Kills",true) == 0) MAXKILLS = strval(value);
		else if(strcmp(cname,"Max-Rounds",true) == 0) MaxRounds = strval(value);
		else if(strcmp(cname,"Weapon1",true) == 0) wpn1 = strval(value);
		else if(strcmp(cname,"Weapon2",true) == 0) wpn2 = strval(value);
		else if(strcmp(cname,"Weapon3",true) == 0) wpn3 = strval(value);
		else if(strcmp(cname,"Ammo1",true) == 0) ammo1 = strval(value);
		else if(strcmp(cname,"Ammo2",true) == 0) ammo2 = strval(value);
		else if(strcmp(cname,"Ammo3",true) == 0) ammo3 = strval(value);
	}
	
	fclose(fhandle);
	return 1;
}
scriptfiles/ClanConfig.txt

Team-1 D$K1
Team-2 D$K2
Max-Clan-Kills 3
Max-Rounds 3
Weapon1 26
Weapon2 28
Weapon3 0
Ammo1 99999
Ammo2 99999
Ammo3 0


this is what we need i think
if need anything else tell me i'll post it too and yeah im new here in these forums ;P
Reply
#4

any help?
Reply
#5

In what variable do you store the team name?
Reply
#6

yes it detect the name of TEAM1 and TEAM2 from .txt file
and i want to change the team names directly in game?
for example

TEAM1 D$K
TEAM2 D$K2

so how to change "D$K" & "D$K2" in game, will be very appreciated
Reply
#7

Then i would do like this:

pawn Код:
stock ChangeClanName(Clan[], nName[])
{
     strmid(Clan, nName, 0, sizeof( nName +1 ), sizeof( nName +1 ));
}
Reply
#8

then hows gonna be the command? sry im little bit noob @scripting and thanks very much mate
Reply
#9

help...
Reply
#10

pawn Код:
command(cname, playerid, params[])
{
     new cTeam, cName[50];
     if(sscanf(params, "is[50]", cTeam, cName)) return SendClientMessage(playerid, COLOR_RED, "Usage: /cname [ Team ( 1 - 2 ) - Name");
     if(cTeam == 1 ) ChangeClanName(TEAM1, cName);
     else if(cTeam == 2 ) ChangeClanName(TEAM2, cName);
     else return SendClientMessage(playerid, COLOR_RED, "Error: Invalid team.");
}

Not sure if it works though :PP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)