Raised This Month: $51 Target: $400
 12% 

API Scripting Help get zombie class name (5.0)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-18-2011 , 14:30   get zombie class name (5.0)
Reply With Quote #1

#include <zp50_class_zombie>
PHP Code:
/**
 * Returns a zombie class' name.
 *
 * @param classid    A valid zombie class ID.
 * @param name        The buffer to store the string in.
 * @param len        Character size of the output buffer.
 * @return            True on success, false otherwise.
 */
native zp_class_zombie_get_name(classidname[], len
I try this:
PHP Code:
    // Get his name
    
new zc_name[32]
    
get_user_name(idname31)

    
zp_class_zombie_get_name(idzc_name31)

    if (
is_user_alive(id))// bla bla bla
    
{
            
ColorChat(0RED"[%s] %s^x01: %s"zc_namename);
    } 
Why then this option gives not the correct name of zombies. Can I something wrong?

Last edited by CHyCMyMpNk; 11-18-2011 at 14:32.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-18-2011 , 22:09   Re: get zombie class name (5.0)
Reply With Quote #2

PHP Code:
new zc_name[32
should be

PHP Code:
new zc_name[32], name[32
also if you are checking if he is a zombie i'l teech you:

1st. #include <zp50_core>

and use zp_core_is_zombie(id) - check if player is a zombie
__________________
Snaker beatter is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-19-2011 , 00:50   Re: get zombie class name (5.0)
Reply With Quote #3

Snaker beatter, I did, I just wrote a short.

PHP Code:
    // Get his name
    
new zc_name[32], name[32]
    
get_user_name(idname31)

    
zp_class_zombie_get_name(idzc_name31)

    if (
is_user_alive(id) && zp_core_is_zombie(id))// bla bla bla
    
{
            
ColorChat(0RED"[%s] %s^x01"zc_namename);
    } 
It not work correctly.

Last edited by CHyCMyMpNk; 11-19-2011 at 00:53.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-19-2011 , 01:15   Re: get zombie class name (5.0)
Reply With Quote #4

Quote:
Originally Posted by =CHyCMyMpNk
Why then this option gives not the correct name of zombies. Can I something wrong?
I don't understand
__________________

Last edited by Snaker beatter; 11-19-2011 at 01:15.
Snaker beatter is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-19-2011 , 01:47   Re: get zombie class name (5.0)
Reply With Quote #5

Well, see, for instance I ZOMBIE SPEED, but it shows FAT ZOMBIE.
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-19-2011 , 01:49   Re: get zombie class name (5.0)
Reply With Quote #6

zp_class_zombie_get_name(id, zc_name, 31)

should be

zp_class_zombie_get_name(g_zclass_id, zc_name, 31)
__________________
Snaker beatter is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-19-2011 , 03:21   Re: get zombie class name (5.0)
Reply With Quote #7

хм, how about this g_zclass_id ,will be errors...
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-19-2011 , 04:49   Re: get zombie class name (5.0)
Reply With Quote #8

g_zclass_id because you used a native that finds a zclass's name
__________________
Snaker beatter is offline
bartek93tbg
Member
Join Date: Apr 2011
Location: Poland
Old 11-19-2011 , 07:15   Re: get zombie class name (5.0)
Reply With Quote #9

Code:
    new name[32], zc_name[32]

    get_user_name(id, name, 31)

    new current_zclass = zp_class_zombie_get_current(id)

    zp_class_zombie_get_name(current_zclass, zc_name, 31)

    if (is_user_alive(id) && zp_core_is_zombie(id))
        ColorChat(0, RED, "[%s] %s^x01", zc_name, name)
bartek93tbg is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-19-2011 , 08:17   Re: get zombie class name (5.0)
Reply With Quote #10

bartek93tbg, tnx it work. But 1 problem :

[ZP] Invalid zombie class id (-1)


can help for fix it ?)
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
Reply



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 02:01.


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