AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block/change map precaching (https://forums.alliedmods.net/showthread.php?t=46201)

FatalisDK 10-21-2006 08:05

block/change map precaching
 
Upgraded my server from windows to linux, and now a few of my maps are crashing because the mapper used wrong casing.
Example:
Real file is sprites/flame2.spr
Map tries to precache Sprites/flame2.spr
(Not sure if dirs are case sensitive on linux.. but the file isn't being found and crashes hlds)

Also need help with this -> http://ampaste.net/4372

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "Block/Change Precache" #define VERSION "0.1" #define AUTHOR "FatalisDK" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public plugin_precache() {     register_forward(FM_PrecacheModel, "fwdPrecacheModel", 0); } public fwdPrecacheModel(szModel[]) {     // 3 ways I tried         /* 1     if( equal(szModel, "Sprites/flame2.spr", 0) )     {         return FMRES_SUPERCEDE;     }*/         /* 2     copy(szModel, 18, "sprites/flame2.spr")     */         /* 3     if( equal(szModel, "Sprites/flame2.spr", 0) )     {         return FMRES_HANDLED;     }*/ }

Silencer123 10-21-2006 11:44

Re: block/change map precaching
 
1 Attachment(s)
I suggest you Ripent instead of making an AMXX Plugin for a stupidly built Map.
;)

Zenith77 10-21-2006 12:59

Re: block/change map precaching
 
Code:
    if( equal(szModel, "Sprites/flame2.spr", 0) )     {         return FMRES_SUPERCEDE;     }

That probably didn't work because you set the third param to zero (read funcwiki for more info). Oh btw, names are case sensitive on linux (pretty sure).

--->
Code:
equal(szModel, "sprites/flame2.spr");

organizedKaoS 10-21-2006 13:03

Re: block/change map precaching
 
Simplest solution....rename the file and/or folders. ie sprites folder already exist but its trying to precache from Sprites....so make a new folder called Sprites.

If the same file is used by other maps, copy and paste it then make one with the case sensitive name and one with the original name.

Much more easier than making a plugin or using ripent just for some dork's typos.

About your ampaste code, take a look at ghw's juggernaut plugin.

His plugin correctly sets the hud for the players health...his plugin also gives 1000 hp to the juggernaut so you might get some ideas from there too.

Zenith77 10-21-2006 13:37

Re: block/change map precaching
 
Quote:

Originally Posted by organizedKaoS (Post 393566)
Simplest solution....rename the file and/or folders. ie sprites folder already exist but its trying to precache from Sprites....so make a new folder called Sprites.

...

FatalisDK 10-21-2006 13:48

Re: block/change map precaching
 
zenith: the default value for param 3 is 0.
native equal(const a[],const b[],c=0);

organizedKaoS:
get_user_health returns the true health, I'm trying to convert that to what the hud heath shows (the juggernaut plugin doesnt do anything what i want)

organizedKaoS 10-21-2006 15:04

Re: block/change map precaching
 
Quote:

Originally Posted by FatalisDK (Post 393597)
organizedKaoS:
get_user_health returns the true health, I'm trying to convert that to what the hud heath shows (the juggernaut plugin doesnt do anything what i want)

I see...I havent gotten around to playing with the health hud so sorry cant help you out there. But as far as I know and have seen, the hud cant display more than 255 hp/ap.

FatalisDK 10-21-2006 15:07

Re: block/change map precaching
 
Yep.. and I'm trying to convert actual HP (more than 255) to the HP the hud shows (1 byte?.. 0-255..). I don't think anyone understands what I'm trying to do :(.

organizedKaoS 10-21-2006 15:18

Re: block/change map precaching
 
Quote:

Originally Posted by FatalisDK (Post 393628)
Yep.. and I'm trying to convert actual HP (more than 255) to the HP the hud shows (1 byte?.. 0-255..). I don't think anyone understands what I'm trying to do :(.

Well...you could try making an alternate hud just above the default health hud.

So when the player is above 255 health, decrease from the alternate hud first until players health is at/below/equal to 255. If you go this route, you might also have to update the default hud as well as I believe it may still try to display the health change.

After that, remove the alternate hud and the health hud should suffice thereafter.

Just a suggestion.

Good luck.

[ --<-@ ] Black Rose 10-22-2006 06:49

Re: block/change map precaching
 
My bad.


All times are GMT -4. The time now is 04:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.