SA-MP Forums Archive
Gangs - 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: Gangs (/showthread.php?tid=84479)



Gangs - Jamould - 01.07.2009

Just wondering how I would make a /Creategang command that saves. Like /Creategang [name][color] for color you would put in a hex code like /Creategang Grove Street D900C8. This is for Pen1.
So far Ive got
Код:
if (strcmp(cmd, "/CreateGang", true) ==
  {
    new gangid;
    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GRAD1, "  /CreateGang [name][color]");
			return 1;
		}
		if (gPlayerLogged[playerid] == 0)
		{
			SendClientMessage(playerid, COLOR_GRAD1, "  You need to login to create a Gang");
      return 1;
    }
    	new gangName[256];
    	GetGangName(gangid);
		format(string, sizeof(string),"%s.Gang",gangName);
	  if (fexist(string))
		{
			SendClientMessage(playerid, COLOR_GRAD1, "  That Gang aready exists");
			return 1;
		}
		GetGangName(gangid);
    new var[32];//
		format(string, sizeof(string), "%s.Gang", gangName);
		new File: file = fopen(string, io_read);
		if (file)
		{
			SendClientMessage(playerid, COLOR_GRAD1, "  That Gang already exists");
			fclose(file);
			return 1;
		}
    GetPlayerName(playerid, playername, sizeof(playername));
		new File:hFile;
		hFile = fopen(string, io_append);
		format(var, 32, "%d gColor\n", GangInfo[gColor]);fwrite(hFile, var);
	  format(var, 32, "%s gLeader\n", GangInfo[gLeader]);fwrite(hFile, var);
		format(var, 32, "%s gMembers\n", GangInfo[gMembers]);fwrite(hFile, var);
		fclose(hFile);
	  return 1;
	}



Re: Gangs - Macauley - 03.07.2009

Im interested in this answer too, but mine if for godfather, if anyone can reply, that would be great.


Re: Gangs - ACERS - 03.07.2009

You have to ask in PEN1 thread ..


Re: Gangs - Jamould - 04.07.2009

Not really considering this is a scripting question


Re: Gangs - Grim_ - 04.07.2009

Quote:
Originally Posted by Jamould
Not really considering this is a scripting question
Ya rly since this has to do with that gamemode.


Re: Gangs - Jamould - 04.07.2009

Not really this is a question about scripting its completely new code. Im getting sick of this shite nobody replies unless theyve got something bad to say.If youve not got anything good to say dont say anything at all


Re: Gangs - saiberfun - 04.07.2009

Quote:
Originally Posted by Jamould
Not really this is a question about scripting its completely new code. Im getting sick of this shite nobody replies unless theyve got something bad to say.If youve not got anything good to say dont say anything at all
so why dont u just ask in the Pen1 Thread?
im sure ull be helped there


Re: Gangs - Jamould - 04.07.2009

Its the same wherever you post it. Im pretty sure Ill be told to post in scripting discussion