Resolved Need Help with an extra item code

Coding Help/Re-API Supported
Post Reply
johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

Need Help with an extra item code

#1

Post by johnnysins2000 » 2 Years Ago

I have seen these codes in many zp extra item and i want to know that if i am converting it into ze extra item what should i change in this code

Code: Select all

public zp_user_infected_post(id)
{
	if (zp_get_user_zombie(id))
	{
		g_has_janus7[id] = false;
		g_sound[id] = false;
		emit_sound(id, CHAN_WEAPON, Fire_snd[g_mode[id]], 0.0, ATTN_NORM, 0, PITCH_NORM);
		g_mode[id] = false;
		g_shots[id] = false;
	}
}

Notice here please ... The code has zp_get_user_zombie(id)

I should change this into ze_is_zombie(id) ?



And for this one also

Code: Select all

replace_weapon_models(id, weaponid)
{
	static g_wpn[33];
	switch (weaponid)
	{
		case wId:
		{
			if(is_user_alive(id) && is_user_connected(id) && g_has_janus7[id])
			{
				if (zp_get_user_zombie(id) || zp_get_user_survivor(id))
					return;
				if(g_wpn[id] != CSW_M249){
					if( g_mode[id]) UTIL_PlayWeaponAnimation(id, 8);
					else UTIL_PlayWeaponAnimation(id, g_shots[id]>50?14:2);
				}
				set_pev(id, pev_viewmodel2, JANUS7_VMODEL);
				set_pev(id, pev_weaponmodel2, JANUS7_PMODEL);
			}
		}
	}
	if(is_user_alive(id))g_wpn[id] = get_user_weapon(id);
}

Notice here please .....


if (zp_get_user_zombie(id) || zp_get_user_survivor(id))


I need to change this into what?
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 2 Years Ago

-For the first one it will be:

  1. public ze_user_infected(id)
  2. {
  3.     if (ze_is_user_zombie(id))
  4.     {
  5.         g_has_janus7[id] = false;
  6.         g_sound[id] = false;
  7.         emit_sound(id, CHAN_WEAPON, Fire_snd[g_mode[id]], 0.0, ATTN_NORM, 0, PITCH_NORM);
  8.         g_mode[id] = false;
  9.         g_shots[id] = false;
  10.     }
  11. }

-For the second one:

  1. replace_weapon_models(id, weaponid)
  2. {
  3.     static g_wpn[33];
  4.     switch (weaponid)
  5.     {
  6.         case wId:
  7.         {
  8.             if(is_user_alive(id) && is_user_connected(id) && g_has_janus7[id])
  9.             {
  10.                 if (ze_is_user_zombie(id))
  11.                     return;
  12.                
  13.                 if(g_wpn[id] != CSW_M249){
  14.                     if( g_mode[id]) UTIL_PlayWeaponAnimation(id, 8);
  15.                     else UTIL_PlayWeaponAnimation(id, g_shots[id]>50?14:2);
  16.                 }
  17.                 set_pev(id, pev_viewmodel2, JANUS7_VMODEL);
  18.                 set_pev(id, pev_weaponmodel2, JANUS7_PMODEL);
  19.             }
  20.         }
  21.     }
  22.     if(is_user_alive(id))g_wpn[id] = get_user_weapon(id);
  23. }

You don't need survivor this is simply ZE not have survivor like ZP so remove it if you find it anywhere.
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#3

Post by johnnysins2000 » 2 Years Ago

Thanks Raheem :)

For Helping
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#4

Post by johnnysins2000 » 2 Years Ago

Now i can also finish the Plasma Gun Code
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#5

Post by Raheem » 2 Years Ago

It will be nice if you share the full final working plugins in our Extra-Item Section. Create new thread with name, Converted Items and add all work you done.
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#6

Post by johnnysins2000 » 2 Years Ago

Yes I already have plan That from the start Raheem

As soon as I am Done With My Testing
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#7

Post by Raheem » 2 Years Ago

johnnysins2000 wrote:
2 Years Ago
Yes I already have plan That from the start Raheem

As soon as I am Done With My Testing
Nice and thanks for your support :).
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#8

Post by johnnysins2000 » 2 Years Ago

I have again updated The VIP code with parachute u can check Raheem
Nobody Is That Busy If They Make Time :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest