new model;
public LoadRace(tmp[]) { new string[256]; new race_name[50]; format(race_name, sizeof(race_name), "%s.type", tmp); new File:gfile = fopen(race_name, io_read); fread(gfile, string), model = strval(string); fclose(gfile); if(model == 0) { format(ystring,128,"[INFO]: une course a pied se prйpare!"); return 1; } if(model == 1) { format(ystring,128,"[INFO]: une course de voiture se prйpare!"); return 1; } if(model == 2) { format(ystring,128,"[INFO]: une course de moto se prйpare!"); return 1; } //------------------------STOP MY CHANGE SendClientMessageToAll(COLOR_YELLOW,ystring); new templine[512]; format(CRaceName,sizeof(CRaceName), "%s",tmp); format(race_name,sizeof(race_name), "%s.yr",tmp); if(!fexist(race_name)) return -1; // File doesn't exist CFile=race_name; LCurrentCheckpoint=-1; RLenght=............................................. ......... ......... ......... }
model=2
if(model == 0) { format(ystring,128,"[INFO]: une course a pied se prйpare!"); return 1; } else if(model == 1) { format(ystring,128,"[INFO]: une course de voiture se prйpare!"); return 1; } else if(model == 2) { format(ystring,128,"[INFO]: une course de moto se prйpare!"); return 1; }
public LoadRace(tmp[]) { new string[256]; new race_name[50]; format(race_name, sizeof(race_name), "%s.type", tmp); new File:gfile = fopen(race_name, io_read); fread(gFile, string, sizeof(string)); model = string; fclose(gfile); if(model == 0) { SendClientMessageToAll(COLOR_YELLOW,"[INFO]: une course a pied se prйpare!"); return 1; } else if(model == 1) { SendClientMessageToAll(COLOR_YELLOW,"[INFO]: une course de voiture se prйpare!"); return 1; } else if(model == 2) { SendClientMessageToAll(COLOR_YELLOW,"[INFO]: une course de moto se prйpare!"); return 1; } }
new string[256]; new race_name[50]; format(race_name, sizeof(race_name), "%s.type", tmp); new File:gfile = fopen(race_name, io_read); fread(gfile, string, sizeof(string)); 2160: model = string; fclose(gfile);
Originally Posted by pawn-lang.pdf
Error 006: Must be assigned to an array:
String literals or arrays must be assigned to an array. This error message may also indicate a missing index (or indices) at the array on the right side of the “=” sign. |
new string[256]; new race_name[50]; format(race_name, sizeof(race_name), "%s.type", tmp); new File:gfile = fopen(race_name, io_read); fread(gfile, string, sizeof(string)); model = string[100]; fclose(gfile); if(model == 0) { format(ystring,128,"[INFO]: une course a pied se prйpare!"); return 1; } else if(model =........... ... ...