Raised This Month: $ Target: $400
 0% 

get weapons(death) - give weapons (alive)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 13:47   get weapons(death) - give weapons (alive)
Reply With Quote #1

Hi again
So: when a player dies, get the players weapons...and make a functionthat revives the player, and gives back to player the weapons that here carryed before death.
Any help ?
__________________

anakin_cstrike is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 08-27-2008 , 14:58   Re: get weapons(death) - give weapons (alive)
Reply With Quote #2

Try this,not tested.
Attached Files
File Type: sma Get Plugin or Get Source (weapon_restore.sma - 689 views - 1.4 KB)
danielkza is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 15:00   Re: get weapons(death) - give weapons (alive)
Reply With Quote #3

Quote:
Originally Posted by danielkza View Post
Try this,not tested.
I'll try a.s.a.p
__________________

anakin_cstrike is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 08-27-2008 , 15:35   Re: get weapons(death) - give weapons (alive)
Reply With Quote #4

Previous version didn't work,this one does:
Attached Files
File Type: sma Get Plugin or Get Source (weapon_restore.sma - 662 views - 1.7 KB)
danielkza is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-28-2008 , 10:36   Re: get weapons(death) - give weapons (alive)
Reply With Quote #5

Are you shure it works ?
__________________

anakin_cstrike is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-28-2008 , 11:35   Re: get weapons(death) - give weapons (alive)
Reply With Quote #6

Teehee I'm at school right now

Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta_util> new bool:g_respawn[33]; new g_weapons[33][32]; new g_weapon_count[33]; public plugin_init() {     register_plugin("Respawn With Same Weapons", "0.1", "Exolent");         RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);     RegisterHam(Ham_Killed, "player", "FwdPlayerDeath"); } public client_disconnect(plr) {     g_respawn[plr] = false; } public FwdPlayerSpawn(plr) {     if( is_user_alive(plr) && g_respawn[plr] )     {         set_task(0.1, "TaskStripWeapons", plr);         set_task(0.3, "TaskGiveWeapons", plr);                 g_respawn[plr] = false;     } } public FwdPlayerDeath(plr) {     if( is_user_connected(plr) )     {         get_user_weapons(plr, g_weapons[plr], g_weapon_count[plr]);                 set_pev(plr, pev_health, 1.0);                 g_respawn[plr] = true;                 set_task(0.1, "TaskSpawnPlayer", plr);                 return HAM_SUPERCEDE;     }         return HAM_IGNORED; } public TaskStripWeapons(plr) {     fm_strip_user_weapons(plr); } public TaskGiveWeapons(plr) {     new total = g_weapon_count[plr];         new name[32];     for( new i = 0; i < total; i++ )     {         get_weaponname(g_weapons[plr][i], name, sizeof(name) - 1);                 ham_give_weapon(plr, name);     } } public TaskSpawnPlayer(plr) {     ExecuteHamB(Ham_CS_RoundRespawn, plr); } stock ham_give_weapon(id,weapon[]) {     if(!equali(weapon,"weapon_",7))         return 0;     new wEnt = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,weapon));     if(!pev_valid(wEnt))         return 0;         set_pev(wEnt,pev_spawnflags,SF_NORESPAWN);     dllfunc(DLLFunc_Spawn,wEnt);         if(!ExecuteHamB(Ham_AddPlayerItem,id,wEnt))     {         if(pev_valid(wEnt))             set_pev(wEnt,pev_flags,pev(wEnt,pev_flags) | FL_KILLME);         return 0;     }     ExecuteHamB(Ham_Item_AttachToPlayer,wEnt,id);         return 1; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 04-25-2011, 00:09
peterfernandes238
This message has been deleted by xPaw. Reason: Spam.
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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