AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I cant test this plugin right now (https://forums.alliedmods.net/showthread.php?t=48290)

godlike 12-09-2006 11:35

I cant test this plugin right now
 
1 Attachment(s)
hej , i made a simple plugin its called amx santa.Its just a plugin that will change a player into a santa model and it will give him speed , hp , armor , and a sexie glow. I cant test this right now because i dont have steam here.
I tried to download it but my comp is to slow for it .( win98 ) So i wanna ask you to try it out for me. the cvar is amx_santa nick (you will need the admin_cvar flag). place the player model at models/player/santa/santa.mdl .and please tell me if it works this is just beta need alot of changes probably. thank you for your time.

XxAvalanchexX 12-09-2006 17:17

Re: I cant test this plugin right now
 
Right now your SetModel function won't effect the player you tell it to, it will effect the player calling the function. This is because, instead of grabbing the arguments passed and getting a user from it, you just use the id of the player who called it.

But, your model change won't work anyway. cs_set_user_model takes the name of the model, not the path. So, in this case, you would use the name "santa".

Here is how I would do it.

Code:
// we added level and cid, since they are also passed. // we use these to figure out if they have access. public SetModel(id,level,cid) {     // make sure they have access and that they put in arguments     if(!cmd_access(id,level,cid,2)) {         return PLUGIN_CONTINUE     }     // get the name they put in     new name[32]     read_argv(1,name,31)     // match the name to a player     new target = cmd_target(id,name,2) // flag 2 = allow yourself     // this player isn't here     if(!target) {         return PLUGIN_CONTINUE     }     // changed id (player calling function) to target (player targeted)     cs_set_user_model(target, "models/player/santa/santa.mdl")     set_user_health(target, 250)       set_user_armor(target, 500)     //set_user_rendering(target, kRenderFxNone, 0, 0, 0, kRenderNormal, percentage)     set_user_rendering(target, kRenderFxNone, 225, 0, 0, kRenderGlow, 100)     set_user_maxspeed(target, 640.0)         return PLUGIN_CONTINUE }

Also, you don't need to return anything in plugin_init or plugin_precache.

godlike 12-09-2006 18:52

Re: I cant test this plugin right now
 
Well thank you avalanche. like you see im just a noob in amx scripting still need to learn alot.


All times are GMT -4. The time now is 08:01.

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