Please Help Me!
#1

I added this to my gang create command..it saves the gang which has been created
but now i want to load the gang in another command from the file
but I don't know how =(

Код:
		//Create Gang//
		if(gangcmd==1) {
		  if(playerGang[playerid]>0) {
				SendClientMessage(playerid, 0x83BFBFFF, "You are already in a gang!");
				return 1;
		  }

			for(new i = 1; i < MAX_GANGS; i++) {
				if(gangInfo[i][0]==0) {
				  //name gang
					format(gangNames[i], MAX_GANG_NAME, "%s", tmp);
					//Gang exists
					gangInfo[i][0]=1;
					//There is one member
					gangInfo[i][1]=1;
					//Gang color is player's color
					gangInfo[i][2]=playerColors[playerid];

					//Player is the first gang member
					gangMembers[i][0] = playerid;
					format(string, sizeof(string),"You have created the gang '%s' (id: %d)", gangNames[i], i);
					SendClientMessage(playerid, 0x83BFBFFF, string);
					playerGang[playerid]=i;
					
					//--------SAVEGANG------------------------------------------
					new player[MAX_PLAYERS];
					GetPlayerName(playerid,player,sizeof(player));

					new File:GangFile;
	      	        format(string, sizeof(string), "%s_Gang.cer", player);
	                GangFile = fopen(string, io_append);
		            new var[32];
					format(var, 32, "Gang?=%d\n", playerGang[playerid]);fwrite(GangFile, var);
                    format(var, 32, "Gang:=%s\n",gangNames[i]);fwrite(GangFile, var);
		            fclose(GangFile);
					return 1;
					//-------SAVEGANG-------------------------------------------
          }
				}
			}

			return 1;
Could anyone tell me how to do ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)