AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Confusing things ( for me ) (https://forums.alliedmods.net/showthread.php?t=252787)

Krtola 12-09-2014 12:03

Confusing things ( for me )
 
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 


simanovich 12-09-2014 12:06

Re: Confusing things ( for me )
 
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).

Krtola 12-11-2014 07:41

Re: Confusing things ( for me )
 
Quote:

Originally Posted by simanovich (Post 2232969)
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 12-15-2014 15:13

Re: Confusing things ( for me )
 
I do not understand where to put
PHP Code:

hamsandwich_amxx.dll 

Some help please?

YamiKaitou 12-15-2014 15:23

Re: Confusing things ( for me )
 
You put that file with all the other AMXX modules

Krtola 12-15-2014 16:36

Re: Confusing things ( for me )
 
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"


fysiks 12-15-2014 18:47

Re: Confusing things ( for me )
 
Quote:

Originally Posted by Krtola (Post 2235803)
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.

Krtola 12-15-2014 18:57

Re: Confusing things ( for me )
 
Quote:

Originally Posted by fysiks (Post 2235830)
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?

fysiks 12-15-2014 21:06

Re: Confusing things ( for me )
 
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.

Krtola 12-23-2014 16:38

Re: Confusing things ( for me )
 
Quote:

Originally Posted by fysiks (Post 2235861)
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.


All times are GMT -4. The time now is 15:31.

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