Serveris

Ja kas neizprotams.

Moderator: Moderatori

Post Reply
[CrC]reinixx
Jauniņais
Jauniņais
Posts: 3
Joined: 24 Aug 2010, 11:35

Serveris

Post by [CrC]reinixx »

Tātat, vispirms, labdien ! Sakarā ar to ka nomainījās sa-mp versija, atjaunināju savu serveri, speles modu "re-compil'ēju" ,bet izmeta 3 kļūdas, ne jau spēles modā bet "include" failā.. man sanāk tā ka spēles mods taisīts ir uz vecajān "include" versijām. Kāds var palīdzēt ??
P.s Tas ir jaunais fails (jaunā versija)
Kļūdas :

Code: Select all

../include/gl_common.inc(75) : error 021: symbol already defined: "strtok"
../include/gl_common.inc(90) : error 047: array sizes do not match, or destination array is too small
../include/gl_common.inc(134) : error 021: symbol already defined: "isNumeric"
un include fails.. http://pastebin.com/P4umk5FY vai

Code: Select all

//----------------------------------------------------------
//
// GRAND LARCENY common functions include.
//
//----------------------------------------------------------

stock LoadStaticVehiclesFromFile(const filename[])
{
	new File:file_ptr;
	new line[256];
	new var_from_line[64];
	new vehicletype;
	new Float:SpawnX;
	new Float:SpawnY;
	new Float:SpawnZ;
	new Float:SpawnRot;
    new Color1, Color2;
	new index;
	new vehicles_loaded;

	file_ptr = fopen(filename,filemode:io_read);
	if(!file_ptr) return 0;

	vehicles_loaded = 0;

	while(fread(file_ptr,line,256) > 0)
	{
	    index = 0;

	    // Read type
  		index = token_by_delim(line,var_from_line,',',index);
  		if(index == (-1)) continue;
  		vehicletype = strval(var_from_line);
   		if(vehicletype  611) continue;

  		// Read X, Y, Z, Rotation
  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnX = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnY = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnZ = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnRot = floatstr(var_from_line);

  		// Read Color1, Color2
  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		Color1 = strval(var_from_line);

  		index = token_by_delim(line,var_from_line,';',index+1);
  		Color2 = strval(var_from_line);

  		//printf("%d,%d,%f,%f,%f,%f,%d,%d",total_vehicles_from_files+vehicles_loaded+1,vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);

		AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); // respawn 30 minutes
		vehicles_loaded++;
	}

	fclose(file_ptr);
	printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
	return vehicles_loaded;
}

//----------------------------------------------------------

stock strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index  ' ') && ((index - offset)  '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
             || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
             || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
         ) return false;
    }
  if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  return true;
}

//----------------------------------------------------------

stock IsKeyJustDown(key, newkeys, oldkeys)
{
	if((newkeys & key) && !(oldkeys & key)) return 1;
	return 0;
}

//----------------------------------------------------------
[/code]
User avatar
[AoD]Aleksis
Nelabojams spameris
Nelabojams spameris
Posts: 3891
Joined: 25 May 2008, 14:05
Location: Tepat.

Re: Serveris

Post by [AoD]Aleksis »

iespējams, ka tavā gm jau ir definēts strtok un isnumeric, mēģini atrast un izdzēst.
Image
[CrC]reinixx
Jauniņais
Jauniņais
Posts: 3
Joined: 24 Aug 2010, 11:35

Re: Serveris

Post by [CrC]reinixx »

"[AoD]Aleksis"]iespējams, ka tavā gm jau ir definēts strtok un isnumeric, mēģini atrast un izdzēst.
labi mēģināšu. ;)
EDIT: nekā.. :(
EDIT2: problēma jau nav GM, bet gan include failā., jo kad gribu kopmpilēt viņš pasaka ka includā ir definēts.
EDIT3: šķiet novērsu.. include failā izdzēsu visu isnumeric un strtok līnijas un palika tikai viena nedefināta GM funkcija. ;) tas ir GM'ā.
Post Reply