Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock LoadMap(path[], Float:offZ = 0.0){
- if(UnloadMap())
- {
- new loadstr[400],mapValues[mapData],count;
- if(!fexist(path))return 0;
- new File:fhandle = fopen(path,io_read);
- new IchStinke;
- while(fread(fhandle, loadstr))
- {
- if(!loadstr[0])continue;
- if(!sscanf(loadstr, "p<\">'object''model='d'posX='f'posY='f'posZ='f'rotX='f'rotY='f'rotZ='f",mapValues[pMmodelid], mapValues[pMX], mapValues[pMY], mapValues[pMZ], mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ])){
- DerbyObjects[IchStinke] = CreateDynamicObject(mapValues[pMmodelid], mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ, mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ],-1,-1,-1,300.0,300.0);
- printf("Objects: %i", DerbyObjects[d]);
- }else if(!sscanf(loadstr, "p<\">'racepickup''type='s[30]'vehicle='d'posX='f'posY='f'posZ='f'rotX='f'rotY='f'rotZ='f",mapValues[pMtype],mapValues[pMmodelid], mapValues[pMX], mapValues[pMY], mapValues[pMZ], mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ])){
- if(strcmp(mapValues[pMtype],"nitro") == 0)CreateRacePickup(mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,1);
- else if(strcmp(mapValues[pMtype],"repair") == 0) CreateRacePickup(mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,2);
- else if(strcmp(mapValues[pMtype],"vehiclechange") == 0)CreateRacePickup(mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,3,mapValues[pMmodelid]);
- }else if(!sscanf(loadstr, "p<\">'spawnpoint''vehicle='d'posX='f'posY='f'posZ='f'rotX='f'rotY='f'rotZ='f",mapValues[pMmodelid], mapValues[pMX], mapValues[pMY], mapValues[pMZ], mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ])){
- ++count;
- CreateRaceSpawn(mapValues[pMmodelid], mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ, mapValues[pMRZ],count);
- }else if(!sscanf(loadstr, "p<\">'marker''color='s[10]'posX='f'posY='f'posZ='f",mapValues[pMtype],mapValues[pMX], mapValues[pMY], mapValues[pMZ])){
- mapValues[pMmodelid] = CreateDynamicObject(1559,mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,0.0,0.0,0.0,-1,-1,-1,400.0,400.0);
- mapValues[pMcolorID] = ConvertStringToHex(mapValues[pMtype]);
- SetDynamicObjectMaterial(mapValues[pMmodelid], 0, 1231, "dynsigns", "white64", mapValues[pMcolorID]);
- }else if(!sscanf(loadstr, "p<\">'speedboost''posX='f'posY='f'posZ='f'veloX='f'veloY='f'veloZ='f", mapValues[pMX], mapValues[pMY], mapValues[pMZ], mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ])){
- CreateRacePickup(mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,4, 0 ,mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ]);
- } else if(!sscanf(loadstr, "p<\">'teleport''posX='f'posY='f'posZ='f'nposX='f'nposY='f'nposZ='f'rotX='f'rotY='f'rotZ='f",mapValues[pMX], mapValues[pMY], mapValues[pMZ], mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ],mapValues[pNMRZ],mapValues[pNMRZ],mapValues[pNMRZ])){
- CreateRacePickup(mapValues[pMX], mapValues[pMY], mapValues[pMZ]+offZ,5 , 0 ,mapValues[pMRX], mapValues[pMRY], mapValues[pMRZ]+offZ,mapValues[pNMRZ]);
- }
- IchStinke++;
- }
- fclose(fhandle);
- if(!count)return print("Map konnte nicht geladen werden"),0;
- print("Map wurde geladen");
- strdel(path,strfind(path,"objects.map"),strlen(path));
- strdel(loadstr,0,sizeof(loadstr));
- format(loadstr,40,"%smeta.xml",path);
- LoadFromMeta(loadstr);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement