Solved Need Help with an extra item code

Coding Help/Re-API Supported
Post Reply
johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

Need Help with an extra item code

#1

Post by johnnysins2000 » 7 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
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 7 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.
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#3

Post by johnnysins2000 » 7 years ago

Thanks Raheem :)

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

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#4

Post by johnnysins2000 » 7 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
Posts: 2214
Joined: 7 years ago
Contact:

#5

Post by Raheem » 7 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.
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#6

Post by johnnysins2000 » 7 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
Posts: 2214
Joined: 7 years ago
Contact:

#7

Post by Raheem » 7 years ago

johnnysins2000 wrote: 7 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 :).
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#8

Post by johnnysins2000 » 7 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

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest