invalid map message - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: invalid map message (
/showthread.php?tid=65807)
invalid map message -
My_Waffles_Bitch_L0L - 16.02.2009
noobs keep crashin my server cuz when they load a invalid map, the server just crashes :<
so, i need to make it show a message when a invalid map is loaded
this were taked from medit (edited a bit)
Код:
dcmd_loadmap(playerid, cmdtext[] = "") {
new map_name[32],templine[128],tempobject[object_info];
if(strlen(cmdtext) == 0 || strlen(cmdtext) >= 30) {
map_name = "default.map";
} else {
format(map_name, 32, "%s.map",cmdtext);
}
new File:f,i,j;
f = fopen(map_name,io_read);
while(fread(f,templine,sizeof(templine),false)) {
new index;
tempobject[object_id] = INVALID_OBJECT_ID;
tempobject[modelid] = strval(strtok(templine,index));
tempobject[ox] = floatstr(strtok(templine,index));
tempobject[oy] = floatstr(strtok(templine,index));
tempobject[oz] = floatstr(strtok(templine,index));
tempobject[rx] = floatstr(strtok(templine,index));
tempobject[ry] = floatstr(strtok(templine,index));
tempobject[rz] = floatstr(strtok(templine,index));
for(i = j; i < MAX_OBJECTS; i++) {
j++;
if(objects[i][object_id] == INVALID_OBJECT_ID || !IsValidObject(objects[i][object_id])) {
tempobject[object_id] = CreateObject(tempobject[modelid],tempobject[ox],tempobject[oy],tempobject[oz],tempobject[rx],tempobject[ry],tempobject[rz]);
objects[i] = tempobject;
break;
}
}
}
fclose(f);
SendClientMessage(playerid, COLOR_YELLOW, "The map has successfully been loaded.");
return 1;
}
so, can i get some help here?
Re: invalid map message -
ICECOLDKILLAK8 - 16.02.2009
Dont include invalid maps on your server?
Re: invalid map message -
My_Waffles_Bitch_L0L - 16.02.2009
how do i dont include them ;I