C:\Users\Admin\Desktop\samp03csvr_R2-2_win32\pawno\include\gl_common.inc(75) : error 021: symbol already defined: "strtok"
C:\Users\Admin\Desktop\samp03csvr_R2-2_win32\pawno\include\gl_common.inc(90) : error 047: array sizes do not match, or destination array is too small
C:\Users\Admin\Desktop\samp03csvr_R2-2_win32\pawno\include\gl_common.inc(134) : error 021: symbol already defined: "isNumeric"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
//topo
#include "../include/gl_common.inc"
Mais so que todas essas linhas ai nгo tem nada estгo em branco '-'
|
//----------------------------------------------------------
//
// 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 < 400 || 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
/*new numplate_test[32+1];
format(numplate_test,32,"GRLC{44AA33}%d",vid);
SetVehicleNumberPlate(vid, numplate_test);*/
vehicles_loaded++;
}
fclose(file_ptr);
printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
return vehicles_loaded;
}
//----------------------------------------------------------
stock strrest(const strt_rest[], &index)
{
new length = strlen(strt_rest);
while ((index < length) && (strt_rest[index] <= ' '))
{
index++;
}
new offset = index;
new result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = strt_rest[index];
index++;
}
result[index - offset] = EOS;
return result;
}
//----------------------------------------------------------
// Tokenise by a delimiter
// Return strt_rest and index of the end determined by the
// provided delimiter in delim
stock token_by_delim(const str_token_carl[], return_str[], delim, start_index)
{
new x=0;
while(str_token_carl[start_index] != EOS && str_token_carl[start_index] != delim) {
return_str[x] = str_token_carl[start_index];
x++;
start_index++;
}
return_str[x] = EOS;
if(str_token_carl[start_index] == EOS) start_index = (-1);
return start_index;
}
//----------------------------------------------------------
stock IsKeyJustDown(key, newkeys, oldkeys)
{
if((newkeys & key) && !(oldkeys & key)) return 1;
return 0;
}
//----------------------------------------------------------