Raised This Month: $ Target: $400
 0% 

Confusing things ( for me )


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-09-2014 , 12:03   Confusing things ( for me )
Reply With Quote #1

Often I meet with some small things whose purpose I not understan.

For example 1:
PHP Code:
public forwardClientSpawn_Postclientattackergib )
{    
    if ( 
IsPlayer(client) && (get_user_flags(client) & ADMIN_LEVEL_H) )        
        
zp_override_user_modelclientg_vipModelHuman[random_num(0sizeof g_vipModelHuman  1)] );    

What's this for,is it necessary to be there?
PHP Code:
gib 
example 2:
PHP Code:
public OnPlayerSpawnPost(id)
{
    if(
is_user_alive(id) && !is_user_zombie(id) && (get_user_flags(id) & VipFlag))
    {
        new 
Float:cHealthFloat:cArmor
        pev
(idpev_healthcHealth)
        
pev(idpev_armorvaluecArmor)
        if(
cHealth VipStartHealthset_pev(idpev_healthVipStartHealth);
        if(
cArmor VipStartArmorset_pev(idpev_armorvalueVipStartArmor);
        
cs_set_user_money(idcs_get_user_money(id)+(2000));
        
give_item(id"weapon_hegrenade")  
        if(!
user_has_weapon(idCSW_HEGRENADE))
                
give_item(id"weapon_hegrenade"
                      
        
//Set player model here.
        
if(!is_user_zombie(id)) cs_set_player_model(idVipModel);
    }

What is the role of a character
PHP Code:

somewhere it has(at the end of the sentence) somewhere it does not
Both examples are for vip player model(skin) and in the second case, which I use there is no
PHP Code:
gib 
Krtola is offline
Send a message via Skype™ to Krtola
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 12-09-2014 , 12:06   Re: Confusing things ( for me )
Reply With Quote #2

1. This parameter has the information about if the player has been (post-method)/will be (pre-method) gibbed after being killed.
2. It's called a semicolon, and it isn't necessary. People use it because the PAWN langauge looks simillar to C++ (where there must be a semicolon).
__________________
simanovich is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-11-2014 , 07:41   Re: Confusing things ( for me )
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
1. This parameter has the information about if the player has been (post-method)/will be (pre-method) gibbed after being killed.
2. It's called a semicolon, and it isn't necessary. People use it because the PAWN langauge looks simillar to C++ (where there must be a semicolon).
Ok,thank you.
Krtola is offline
Send a message via Skype™ to Krtola
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-15-2014 , 15:13   Re: Confusing things ( for me )
Reply With Quote #4

I do not understand where to put
PHP Code:
hamsandwich_amxx.dll 
Some help please?

Last edited by Krtola; 12-15-2014 at 15:14.
Krtola is offline
Send a message via Skype™ to Krtola
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-15-2014 , 15:23   Re: Confusing things ( for me )
Reply With Quote #5

You put that file with all the other AMXX modules
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-15-2014 , 16:36   Re: Confusing things ( for me )
Reply With Quote #6

Ok,thank you.
Are these two examples have the same function:

PHP Code:
register_event("DeathMsg""DeathEvent""a"); 
PHP Code:
RegisterHam(Ham_Killed"player""fw_PlayerKilled"
Krtola is offline
Send a message via Skype™ to Krtola
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-15-2014 , 18:47   Re: Confusing things ( for me )
Reply With Quote #7

Quote:
Originally Posted by Krtola View Post
Ok,thank you.
Are these two examples have the same function:

PHP Code:
register_event("DeathMsg""DeathEvent""a"); 
PHP Code:
RegisterHam(Ham_Killed"player""fw_PlayerKilled"
No, they are not the same function.
__________________
fysiks is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-15-2014 , 18:57   Re: Confusing things ( for me )
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
No, they are not the same function.
Can I use,or can not use both functions for the same purpose,for example when I want to adjust that player loses something when dies?
Krtola is offline
Send a message via Skype™ to Krtola
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-15-2014 , 21:06   Re: Confusing things ( for me )
Reply With Quote #9

It depends on what you are doing. What do you want to do (explain in detail).

Since you are asking scripting questions, you should post a thread in the Scripting Help forum (that is what it is there for). One topic per thread.
__________________

Last edited by fysiks; 12-15-2014 at 21:09.
fysiks is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 12-23-2014 , 16:38   Re: Confusing things ( for me )
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
It depends on what you are doing. What do you want to do (explain in detail).

Since you are asking scripting questions, you should post a thread in the Scripting Help forum (that is what it is there for). One topic per thread.
For example when player die,he lose extra weapons...or any other extra items.
Krtola is offline
Send a message via Skype™ to Krtola
Reply


Thread Tools
Display Modes

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 15:31.


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