hlmod.hu
https://hlmod.hu/

Újraéledés 1szer
https://hlmod.hu/viewtopic.php?f=9&t=4066
Oldal: 1 / 1

Szerző:  GhostRyder [2012.04.14. 14:10 ]
Hozzászólás témája:  Újraéledés 1szer

Helló!

Hogy tudom megcsinálni, hogy csak 1-szer lehessen újraéledni, és csak ct-k tudjanak újraéledni.
Ha valaki megtudja csinálni hogy még "okot" is írjon chatbe, akkor legyenek ezek:
CT-nek ha másodszorra, vagy sokadszorra akar újraéledni: Egy korben csak 1szer tudsz ujraeledni!
T-nek ha ujraakar eledni: Terrorista nemtud ujraeledni!
(Ha "okot" nemtudtok neki írni az nemgond! Lényeg az, amit az elején írtam)

SMA:
Kód:
new const VERSION[] = "1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>

#define DISABLE_CS 0

// team ids 
#define UNASSIGNED 0 
#define TS 1 
#define CTS 2 
#define AUTO_TEAM 5 

new bool:g_PistolsDisabled = false

public plugin_init
(){

    register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

    register_event("DeathMsg","on_Death","a")
    
    register_cvar
("sv_checkpistols", "1")
    register_cvar("sv_respawn", "1")
    register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

    register_clcmd("say","on_Chat")
    register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
    if ( !get_cvar_num("sv_respawn") )
    {
        client_print(id, print_chat, "* Respawn plugin kikapcsolva!")
        return PLUGIN_CONTINUE
    
}

    new szSaid[32]
    read_args(szSaid, 31) 

    if 
(equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^"") || equali(szSaid,"^"/ujra^""))
    {
        spawn_func(id)
    }
    return PLUGIN_HANDLED;
}

public check_pistols()
{
    /* Determine if we should give players a pistol or not */
    if ( get_cvar_num("sv_checkpistols") )
    {
        set_task(1.0, "check_pistols")
        new mapname[32]
        get_mapname(mapname,31) 
        if 
( containi(mapname,"ka_")!=-|| containi(mapname,"scoutzknivez")!=-)
                g_PistolsDisabled = true
    
}
}

public spawn_func(id)
{
    new parm[1]
    parm[0]=id
    
    
/* Spawn the player twice to avoid the HL engine bug */
    set_task(0.5,"player_spawn",72,parm,1)
    set_task(0.7,"player_spawn",72,parm,1)
    set_task(0.9, "hud", id)

    /* Then give them a suit and a knife */
    set_task(0.9,"player_giveitems",72,parm,1)
}

public hud( id )
{
    set_hudmessage(0, 255, 255, -1.0, 0.67, 0, 6.0, 6.0)
    show_hudmessage(id, "Sikeresen Ujraledtel!")
}
public on_Death()
{
    if ( !get_cvar_num("sv_respawn") )
        return PLUGIN_CONTINUE
    
    new victim_id 
= read_data(2)
    
    spawn_func
( victim_id )

    return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
    new id = parm[0]

    give_item(id, "item_suit")
    give_item(id, "weapon_knife")

    /* Determines if a players should be given a pistol */
    if ( !g_PistolsDisabled )
    {
        new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false 
        get_user_weapons
(id,wpnList,number)
        
        
/* Determine if the player already has a pistol */
        for (new i = 0;< number;i++)
        { 
            if 
(wpnList[i] == CSW_GLOCK18) 
                foundGlock 
= true 
            if 
(wpnList[i] == CSW_USP) 
                foundUSP 
= true 
        
}
        
        
/* Give a T his/her pistol */
        if ( get_user_team(id)==TS && !foundGlock )
        {
                give_item(id,"weapon_glock18")
                give_item(id,"ammo_9mm")
                give_item(id,"ammo_9mm")
        }
        /* Give a CT his/her pistol */
        else if ( get_user_team(id)==CTS && !foundUSP )
        {
                give_item(id,"weapon_usp")
                give_item(id,"ammo_45acp")
                give_item(id,"ammo_45acp")
        }
    }

    return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
    spawn(parm[0])


köszi :D

Szerző:  oroszrulett [2012.04.15. 15:13 ]
Hozzászólás témája:  Re: Újraéledés 1szer

Ezen könnyen segíthetünk:

Kód:
[code]new const VERSION[] = "1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <colorchat>

#define DISABLE_CS 0

// team ids
#define UNASSIGNED 0
#define TS 1
#define CTS 2
#define AUTO_TEAM 5

new bool:g_PistolsDisabled = false
new count[33]

public plugin_init(){

    register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

    register_event("DeathMsg","on_Death","a")
    register_event("HLTV", "reset", "a", "1=0", "2=0");
   
    register_cvar("sv_checkpistols", "1")
    register_cvar("sv_respawn", "1")
    register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

    register_clcmd("say","on_Chat")
    register_clcmd("say_team","on_Chat")
}
public reset()
{
   count[0] = 1
}

public on_Chat(id)
{
    if ( !get_cvar_num("sv_respawn") )
    {
        client_print(id, print_chat, "* Respawn plugin kikapcsolva!")
        return PLUGIN_CONTINUE
    }

    new szSaid[32]
    read_args(szSaid, 31)

    if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^"") || equali(szSaid,"^"/ujra^""))
    {
        spawn_func(id)
    }
    return PLUGIN_HANDLED;
}

public check_pistols()
{
    /* Determine if we should give players a pistol or not */
    if ( get_cvar_num("sv_checkpistols") )
    {
        set_task(1.0, "check_pistols")
        new mapname[32]
        get_mapname(mapname,31)
        if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
                g_PistolsDisabled = true
    }
}

public spawn_func(id)
{
   if(cs_get_user_team(id) == CS_TEAM_T)
   {
      ColorChat(id, GREEN, "A T-k nem eledhetnek ujra!")
   }else{
    new parm[1]
    parm[0]=id
   
    /* Spawn the player twice to avoid the HL engine bug */
    set_task(0.5,"player_spawn",72,parm,1)
    set_task(0.7,"player_spawn",72,parm,1)
    set_task(0.9, "hud", id)

    /* Then give them a suit and a knife */
    set_task(0.9,"player_giveitems",72,parm,1)
}
}

public hud( id )
{
    set_hudmessage(0, 255, 255, -1.0, 0.67, 0, 6.0, 6.0)
    show_hudmessage(id, "Sikeresen Ujraledtel!")
}
public on_Death()
{
    if ( !get_cvar_num("sv_respawn") )
        return PLUGIN_CONTINUE
   
   new victim_id = read_data(2)
   
   count[victim_id] -= 1
   if(count[victim_id] <=-1)
   {
      ColorChat(victim_id, GREEN, "Mar 1x ujraeledtel!")
   }else{   
   spawn_func( victim_id )
   }
   
   return PLUGIN_CONTINUE

}

public player_giveitems(parm[1])
{
    new id = parm[0]

    give_item(id, "item_suit")
    give_item(id, "weapon_knife")

    /* Determines if a players should be given a pistol */
    if ( !g_PistolsDisabled )
    {
        new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false
        get_user_weapons(id,wpnList,number)
       
        /* Determine if the player already has a pistol */
        for (new i = 0;i < number;i++)
        {
            if (wpnList[i] == CSW_GLOCK18)
                foundGlock = true
            if (wpnList[i] == CSW_USP)
                foundUSP = true
        }
       
        /* Give a T his/her pistol */
        if ( get_user_team(id)==TS && !foundGlock )
        {
                give_item(id,"weapon_glock18")
                give_item(id,"ammo_9mm")
                give_item(id,"ammo_9mm")
        }
        /* Give a CT his/her pistol */
        else if ( get_user_team(id)==CTS && !foundUSP )
        {
                give_item(id,"weapon_usp")
                give_item(id,"ammo_45acp")
                give_item(id,"ammo_45acp")
        }
    }

    return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
    spawn(parm[0])
}[/code]

Szerző:  GhostRyder [2012.04.15. 15:34 ]
Hozzászólás témája:  Re: Újraéledés 1szer

ty ha gépnél leszek akk kipróbálom...xd

Szerző:  ChaspeR [2012.04.15. 16:16 ]
Hozzászólás témája:  Re: Újraéledés 1szer

Légyszíves tedd már be " Code -ba! " Köszi:)

Szerző:  oroszrulett [2012.04.15. 16:19 ]
Hozzászólás témája:  Re: Újraéledés 1szer

megvan

Szerző:  DeteCT0R [2012.04.15. 22:26 ]
Hozzászólás témája:  Re: Újraéledés 1szer

chasper.cfg írta:
Légyszíves tedd már be " Code -ba! " Köszi:)


Ha lopni akarod akkor kimasolod :)Nemkell ezert megszolitani vagyis amig meg nemvagy modi/imperator/adminisztrator:D

Szerző:  PROTOTYPE [2012.04.15. 22:52 ]
Hozzászólás témája:  Re: Újraéledés 1szer

lol, ezt lehet, hogy beteszem a szeromra, de a t is kellene ujraeledjen :D

Szerző:  oroszrulett [2012.04.16. 19:47 ]
Hozzászólás témája:  Re: Újraéledés 1szer

Prototipenak:
Kód:
/* AMXX Mod script.
*
* (c) Copyright 2004, dkészítő: Geesu
* Ez a fájl csak tájékoztató! ( Nincs garancia ).
*
* Változásnapló
* 1.1:
*  Hozzáadva a /respawn parancs, ha a játékos halott.
*   Hozzáadva egy plugin cvar.
* 1.0:
*   Pisztoly ad a játékosoknak, amikor újraélednek.
*   sv_checkpistols cvar hozzáadva, ha a plugint scoutknivez_ vagy ka_ mapokon akarják használni.
*   sv_respart cvar hozzáadva, hogy ki/be lehessen a plugint kapcsolni.
*/

new const VERZIO[] =   "1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>

#define DISABLE_CS 0

// team ids
#define UNASSIGNED 0
#define TS 1
#define CTS 2
#define AUTO_TEAM 5

new bool:g_PistolsDisabled = false

public plugin_init(){

   register_plugin("Respawn Forever", VERZIO, "Pimp Daddy (OoTOAoO)")

   register_event("DeathMsg","on_Death","a")
   
   register_cvar("sv_checkpistols", "1")
   register_cvar("sv_respawn", "1")
   register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

   register_clcmd("say","on_Chat")
   register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
   if ( !get_cvar_num("sv_respawn") )
   {
      client_print(id, print_chat, "* Respawn plugin kikapcsolva!")
      return PLUGIN_CONTINUE
   }

   new szSaid[32]
   read_args(szSaid, 31)

   if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^"") || equali(szSaid,"^"/ujra^""))
   {
      spawn_func(id)
   }
   return PLUGIN_HANDLED;
}

public check_pistols()
{
   /* Determine if we should give players a pistol or not */
   if ( get_cvar_num("sv_checkpistols") )
   {
      set_task(1.0, "check_pistols")
      new mapname[32]
      get_mapname(mapname,31)
      if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
            g_PistolsDisabled = true
   }
}

public spawn_func(id)
{
   new parm[1]
   parm[0]=id
   
   /* Spawn the player twice to avoid the HL engine bug */
   set_task(0.5,"player_spawn",72,parm,1)
   set_task(0.7,"player_spawn",72,parm,1)
   set_task(0.9, "hud", id)

   /* Then give them a suit and a knife */
   set_task(0.9,"player_giveitems",72,parm,1)
}

public hud( id )
{
   set_hudmessage(0, 255, 255, -1.0, 0.67, 0, 6.0, 6.0)
   show_hudmessage(id, "Sikeresen Ujraledtel!")
}
public on_Death()
{
   if ( !get_cvar_num("sv_respawn") )
      return PLUGIN_CONTINUE
   
   new victim_id = read_data(2)
   
   spawn_func( victim_id )

   return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
   new id = parm[0]

   give_item(id, "item_suit")
   give_item(id, "weapon_knife")

   /* Determines if a players should be given a pistol */
   if ( !g_PistolsDisabled )
   {
      new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false
      get_user_weapons(id,wpnList,number)
      
      /* Determine if the player already has a pistol */
      for (new i = 0;i < number;i++)
      {
         if (wpnList[i] == CSW_GLOCK18)
            foundGlock = true
         if (wpnList[i] == CSW_USP)
            foundUSP = true
      }
      
      /* Give a T his/her pistol */
      if ( get_user_team(id)==TS && !foundGlock )
      {
            give_item(id,"weapon_glock18")
            give_item(id,"ammo_9mm")
            give_item(id,"ammo_9mm")
      }
      /* Give a CT his/her pistol */
      else if ( get_user_team(id)==CTS && !foundUSP )
      {
            give_item(id,"weapon_usp")
            give_item(id,"ammo_45acp")
            give_item(id,"ammo_45acp")
      }
   }

   return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
   spawn(parm[0])
}

Szerző:  ChaspeR [2012.04.16. 21:14 ]
Hozzászólás témája:  Re: Újraéledés 1szer

DeteCT0R írta:
chasper.cfg írta:
Légyszíves tedd már be " Code -ba! " Köszi:)


Ha lopni akarod akkor kimasolod :)Nemkell ezert megszolitani vagyis amig meg nemvagy modi/imperator/adminisztrator:D




Nem szokásom lopni csak kölcsön venni , de nem fáradt voltam kijelölni :D

Szerző:  oroszrulett [2012.04.17. 18:02 ]
Hozzászólás témája:  Re: Újraéledés 1szer

Idézet:
Nem szokásom lopni csak kölcsön venni , de nem fáradt voltam kijelölni :D

Persze arra volt erőd, hogy létrehozz egy új postot, és ilyen szépen kidekoráld a szavakat!
Amúgy szerintem egy plugint nem lehet kölcsönvenni, de ebben az esetben lopni se, mivel azért raktuk fel, hogy mások is használják!

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/