AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] Ham_Spawn -> fakemeta (https://forums.alliedmods.net/showthread.php?t=75863)

xPaw 08-13-2008 16:00

[ Solved ] Ham_Spawn -> fakemeta
 
how to ??

hamsandwich:
PHP Code:

RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1); 

fakemeta ??

butthead 08-13-2008 16:06

Re: Ham_Spawn -> fakemeta
 
register_forward(FM_Spawn, "fwHamPlayerSpawnPost")

ConnorMcLeod 08-13-2008 16:51

Re: Ham_Spawn -> fakemeta
 
FM_Spawn wont work, use this tut : http://forums.alliedmods.net/showthread.php?t=42159

danielkza 08-13-2008 17:26

Re: Ham_Spawn -> fakemeta
 
Quote:

Originally Posted by connorr (Post 669179)
FM_Spawn wont work, use this tut : http://forums.alliedmods.net/showthread.php?t=42159

Or just stick with HamSandwich, it's much better and more reliable than any other method.

grimvh2 08-14-2008 06:46

Re: Ham_Spawn -> fakemeta
 
Quote:

Originally Posted by danielkza (Post 669192)
Or just stick with HamSandwich, it's much better and more reliable than any other method.

the problem is the online compiler doesnt support hamsandwich .
And its always easyer if you dont have to compile it local

ConnorMcLeod 08-14-2008 06:56

Re: Ham_Spawn -> fakemeta
 
compile locally is so easy...

This web compiler support ham : http://webcomp.ak-team.com/index.php

grimvh2 08-15-2008 12:05

Re: Ham_Spawn -> fakemeta
 
I know that its easy :/ ... but other people still dont know how

zwfgdlc 08-15-2008 16:20

Re: Ham_Spawn -> fakemeta
 
try this.
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define PLUGIN_NAME "fm_player_spawn" #define PLUGIN_VERSION  "1.0" #define PLUGIN_AUTHOR   "zwfgdlc" #define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1)) new gMsgRestHud; public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);     gMsgRestHud=get_user_msgid("ResetHUD");     register_forward(FM_MessageBegin,"fw_messgaebegin"); } public fw_messgaebegin(msg_dest,msgid,Float:origin[3],id) {     if(msg_dest==MSG_ONE&&msgid==gMsgRestHud&&is_user_alive(id))     {         server_print("spawn a player!!!!!!");         fm_give_item(id,"weapon_awp");         fm_give_item(id,"ammo_338magnum");         fm_give_item(id,"ammo_338magnum");         fm_give_item(id,"ammo_338magnum");     }         } stock fm_give_item(index, const item[]) {     if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))         return 0     new ent = fm_create_entity(item)     if (!pev_valid(ent))         return 0     new Float:origin[3]     pev(index, pev_origin, origin)     set_pev(ent, pev_origin, origin)     set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)     dllfunc(DLLFunc_Spawn, ent)     new save = pev(ent, pev_solid)     dllfunc(DLLFunc_Touch, ent, index)     if (pev(ent, pev_solid) != save)         return ent     engfunc(EngFunc_RemoveEntity, ent)     return -1 }

Arkshine 08-15-2008 16:36

Re: Ham_Spawn -> fakemeta
 
I don't see the point using MessageBegin here. As far I understand, it's exactly the same using ResetHud event ( register_event() ) and with as check "if ( id && is_user_alive( id ) )", except your code will probably called very often. So, I think it's pointless and overhead to do that.

zwfgdlc 08-15-2008 23:14

Re: Ham_Spawn -> fakemeta
 
Quote:

Originally Posted by arkshine (Post 670157)
I don't see the point using MessageBegin here. As far I understand, it's exactly the same using ResetHud event ( register_event() ) and with as check "if ( id && is_user_alive( id ) )", except your code will probably called very often. So, I think it's pointless and overhead to do that.

You are right. Method that but seemed without others.


All times are GMT -4. The time now is 03:16.

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