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

API Scripting Help Help needed :3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-21-2013 , 17:11   Help needed :3
Reply With Quote #1

Okay, I made human class (edited from default) and I got problem:
when new round starts, it won't give ak47

Here is the code:

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: Classic -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
#include <cstrike>
#include <zombieplague>
#include <zp50_class_human>

// Classic Human Attributes
new const humanclass1_name[] = "Soldier"
new const humanclass1_info[] = "Free guns, slow movement"
new const humanclass1_models[][] = { "gign" "gsg9" "sas" "urban" }
const 
humanclass1_health 110
const Float:humanclass1_speed 1.0
const Float:humanclass1_gravity 1.0

//#define zombies = zp_get_zombie_count();

new g_HumanClassID;

public 
plugin_precache()
{
    
register_plugin("[ZP] Class: Human: Classic"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_HumanClassID zp_class_human_register(humanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity)
    new 
index
    
for (index 0index sizeof humanclass1_modelsindex++)
        
zp_class_human_register_model(g_HumanClassIDhumanclass1_models[index])

}

public 
zp_round_started(gamemodeid) {

    new 
class_name[32];
    
zp_class_human_get_name(zp_class_human_get_current(id), class_namecharsmax(class_name));
    
    if (!
equal(class_name"Soldier") || zp_get_user_zombie(id) ) {
    
        return 
PLUGIN_HANDLED;

    } else {

        
give_item (id"weapon_ak47");
        
cs_set_user_bpammo (id CSW_AK47 60 );

        return 
PLUGIN_HANDLED;

}}

public 
zp_user_last_human(id) {
    if (
zp_get_zombie_count() <= 10) {
    
        
strip_user_weapons(id);
        
give_item (id"weapon_m249")
        
cs_set_user_bpammo (idCSW_M249200);
        
cs_set_user_armor (id 100CS_ARMOR_VESTHELM);
        
client_print (idprint_chat"GO GO GO! Only %d zombies left!"zp_get_zombie_count() )
        return 
PLUGIN_HANDLED;
    } else {
        return 
PLUGIN_HANDLED;

}} 
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 04-21-2013 at 17:13.
jonnzus is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 04-22-2013 , 03:43   Re: Help needed :3
Reply With Quote #2

Quote:
public zp_round_started(gamemode, id)

This is when the gamemode starts, not the round.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-22-2013 , 08:04   Re: Help needed :3
Reply With Quote #3

Hmm, okay. What I should use then? If I replace zp_gamemode started with zp_has_round_started, compiler gives me this error..:d

Code:
zp50_class_human_soldier.sma(44) : error 021: symbol already defined: "zp_has_round_started"
zp50_class_human_soldier.sma(47) : error 021: symbol already defined: "zp_class_human_get_name"
zp50_class_human_soldier.sma(49) : error 010: invalid function or declaration
zp50_class_human_soldier.sma(51) : error 010: invalid function or declaration
zp50_class_human_soldier.sma(53) : error 054: unmatched closing brace
zp50_class_human_soldier.sma(53) : error 010: invalid function or declaration
zp50_class_human_soldier.sma(55) : error 021: symbol already defined: "give_item"
zp50_class_human_soldier.sma(58) : error 010: invalid function or declaration
zp50_class_human_soldier.sma(60) : error 054: unmatched closing brace
zp50_class_human_soldier.sma(74) : warning 209: function "zp_user_last_human" should return a value
zp50_class_human_soldier.sma(77) : warning 203: symbol is never used: "class_name"
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-22-2013 , 12:20   Re: Help needed :3
Reply With Quote #4

y do u use "#include <zombieplague>" if u wanna make it for zp50 ? O.O
Catastrophe is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-22-2013 , 14:10   Re: Help needed :3
Reply With Quote #5

ain't zombieplague.inc for zp 5.0?
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Old 04-22-2013, 15:52
jonnzus
This message has been deleted by jonnzus. Reason: asd
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 04-24-2013 , 14:55   Re: Help needed :3
Reply With Quote #6

Quote:
Originally Posted by jonnzus View Post
ain't zombieplague.inc for zp 5.0?
No. Just use zp50_core instead of zombieplague.inc.
gogicaa is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-25-2013 , 03:11   Re: Help needed :3
Reply With Quote #7

Exactly ...
Catastrophe is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-25-2013 , 20:24   Re: Help needed :3
Reply With Quote #8

Hmm.. I'm only using zp50 files, newer downloaded zp 4.3 stuff to this computer and when i change #include <zombieplague> too #include <zp50_core> I got this:

Code:
Pyssyt.sma(23) : error 017: undefined symbol "zp_is_nemesis_round"
Pyssyt.sma(28) : error 017: undefined symbol "zp_get_user_nemesis"
Pyssyt.sma(37) : error 017: undefined symbol "zp_is_nemesis_round"
Pyssyt.sma(43) : error 017: undefined symbol "zp_get_user_zombie"
Pyssyt.sma(78) : warning 217: loose indentation
Pyssyt.sma(78) : warning 213: tag mismatch
Pyssyt.sma(129) : warning 217: loose indentation
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-26-2013 , 00:45   Re: Help needed :3
Reply With Quote #9

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: Classic -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
#include <cstrike>
#include <zp50_core>
#include <zp50_class_human>


// Classic Human Attributes
new const humanclass1_name[] = "Soldier"
new const humanclass1_info[] = "Free guns, slow movement"
new const humanclass1_models[][] = { "gign" "gsg9" "sas" "urban" }
const 
humanclass1_health 110
const Float:humanclass1_speed 1.0
const Float:humanclass1_gravity 1.0

//#define zombies = zp_get_zombie_count();

new g_HumanClassID;

public 
plugin_precache()
{
    
register_plugin("[ZP] Class: Human: Classic"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_HumanClassID zp_class_human_register(humanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity)
    new 
index
    
for (index 0index sizeof humanclass1_modelsindex++)
        
zp_class_human_register_model(g_HumanClassIDhumanclass1_models[index])

}

public 
zp_round_started(gamemodeid) {

    new 
class_name[32];
    
zp_class_human_get_name(zp_class_human_get_current(id), class_namecharsmax(class_name));
    
    if (!
equal(class_name"Soldier") || zp_core_is_zombie(id) ) {
    
        return 
PLUGIN_HANDLED;

    } else {

        
give_item (id"weapon_ak47");
        
cs_set_user_bpammo (id CSW_AK47 60 );

        return 
PLUGIN_HANDLED;

}}

public 
zp_user_last_human(id) {
    if (
zp_get_zombie_count() <= 10) {
    
        
strip_user_weapons(id);
        
give_item (id"weapon_m249")
        
cs_set_user_bpammo (idCSW_M249200);
        
cs_set_user_armor (id 100CS_ARMOR_VESTHELM);
        
client_print (idprint_chat"GO GO GO! Only %d zombies left!"zp_get_zombie_count() )
        return 
PLUGIN_HANDLED;
    } else {
        return 
PLUGIN_HANDLED;

}} 
This is for zp50, untested.... + where did u put nemesis in this ? Post the original .sma i will fix dat for u...
Catastrophe is offline
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 11:39.


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