View Single Post
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-07-2008 , 19:04   Re: Hobo AFK Management
Reply With Quote #2

You can detect spawn better with hamsandwich:
Code:
RegisterHam(Ham_Spawn, "player", "fwd_Ham_Spawn_post", 1); // ... public fwd_Ham_Spawn_post(id) {     // player spawned }

and you can get rid of the cstrike module with this:

Code:
#include <fakemeta> #define OFFSET_TEAM   114 #define OFFSET_INTERNALMODEL        126 enum CsInternalModel {     CS_DONTCHANGE = 0,     CS_CT_URBAN = 1,     CS_T_TERROR = 2,     CS_T_LEET = 3,     CS_T_ARCTIC = 4,     CS_CT_GSG9 = 5,     CS_CT_GIGN = 6,     CS_CT_SAS = 7,     CS_T_GUERILLA = 8,     CS_CT_VIP = 9,     CZ_T_MILITIA = 10,     CZ_CT_SPETSNAZ = 11 }; enum CsTeams {     CS_TEAM_UNASSIGNED = 0,     CS_TEAM_T = 1,     CS_TEAM_CT = 2,     CS_TEAM_SPECTATOR = 3 }; stock fm_set_user_team(id, {CsTeams,_}:team, {CsInternalModel,_}:model = CS_DONTCHANGE) {     set_pdata_int(id, OFFSET_TEAM, _:team);     if(model)     {         set_pdata_int(id, OFFSET_INERNALMODEL, _:model);     }     dllfunc(DLLFunc_ClientUserInfoChanged, id);     new teaminfo[32];     switch(team)     {         case TEAM_UNASSIGNED: copy(teaminfo, 31, "UNASSIGNED")         case TEAM_T: copy(teaminfo, 31, "TERRORIST")         case TEAM_CT: copy(teaminfo, 31, "CT")         case TEAM_SPECTATOR: copy(teaminfo, 31, "SPECTATOR")             }         static iMsgid_TeamInfo;     if(!iMsgid_TeamInfo)     {         iMsgid_TeamInfo = get_user_msgid("TeamInfo");     }     message_begin(MSG_ALL, iMsgid_TeamInfo);     write_byte(id);     write_string(teaminfo);     message_end(); } stock CsTeams:cs_get_user_team(index, &{CsInternalModel,_}:model = CS_DONTCHANGE) {     model = CsInternalModel:get_pdata_int(id, OFFSET_INTERNALMODEL);         return CsTeams:get_pdata_int(index, OFFSET_TEAM); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline