01.03.2014, 12:34
pawn Код:
public OnGameModeInit()
{
SetGameModeText("- City DM v1.0 -");
new string[128],File:spawnfile = fopen("CityDM/teams.ini",io_read);
while(fread(spawnfile,string))
{
sscanf(string,"p<,>s[15]dddds[30]",TeamInfo[TeamsCreated][TeamName],TeamInfo[TeamsCreated][TeamSkin],TeamInfo[TeamsCreated][TeamWeapon][0],TeamInfo[TeamsCreated][TeamWeapon][1],TeamInfo[TeamsCreated][TeamWeapon][2],TeamInfo[TeamsCreated][spawnfilename]);
TeamInfo[TeamsCreated][TeamCreated] = 1;
AddPlayerClass(TeamInfo[TeamsCreated][TeamSkin],0.0,0.0,0.0,0.0,TeamInfo[TeamsCreated][TeamWeapon][0],15000,TeamInfo[TeamsCreated][TeamWeapon][1],10000,TeamInfo[TeamsCreated][TeamWeapon][2],10000);
printf("CREATED A TEAM (Team %s) (%d)",TeamInfo[TeamsCreated][TeamName],TeamsCreated);
TeamsCreated ++;
}
fclose(spawnfile);
for(new i = 0; i < TeamsCreated; i ++)
{
new count = SpawnCount[i],file[30];
format(file,sizeof(file),"%s",TeamInfo[i][spawnfilename]);
print(file);
spawnfile = fopen(file,io_read);
while(fread(spawnfile,string))
{
sscanf(string,"p<,>ffff",Spawns[i][count][X],Spawns[i][count][Y],Spawns[i][count][Z],Spawns[i][count][A]);
printf("SPAWN ADDED (team %s) (%d) %.2f %.2f %.2f",TeamInfo[i][TeamName],i,Spawns[i][count][X],Spawns[i][count][Y],Spawns[i][count][Z]);
count ++;
}
fclose(spawnfile);
SpawnCount[i] = count;
}
return 1;
}