AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help Req] Round Money (https://forums.alliedmods.net/showthread.php?t=271365)

DeathOrAlive 09-10-2015 19:53

[Help Req] Round Money
 
Hello guys, so I'm trying to make a code for my VIP users to get +1000$ every round (without the first one ofcourse, it would be unfair), but unfortunately I failed... This is my code, can you tell me where am I making a mistake and fix it for me please?
PHP Code:

public onSpawn(Player)
{
    if(
is_user_alive(Player))
    {
        if(
get_user_flags(Player) & ADMIN_RESERVATION)
        {
            
cs_set_user_money(Playerclamp(cs_get_user_money(Player) + 1000016000));
            new 
name[33]
            
get_user_name(Player,name,charsmax(name))
            
ClientPrintColor(Player"^4[^3FrontLineD2^4]^1Because of his ^4VIP privileges^1, player ^3%s^1 is getting^4 1000$^1 bonus!"name)
        }

    }



wickedd 09-10-2015 20:30

Re: [Help Req] Round Money
 
PHP Code:

cs_set_user_money(Playerclamp(cs_get_user_money(Player) + 1000016000)); 

:arrow:
PHP Code:

cs_set_user_money(Player, ( cs_get_user_moneyPlayer ) + 1000)); 

What do you mean by the first round? The first round a player plays or the first round of the map?


Edit:

PHP Code:

public onSpawnPlayer )
{
    new 
name33 ];
    
get_user_namePlayer,name,charsmaxname ) )
    
    if( 
is_user_alivePlayer ) && ( get_user_flagsPlayer ) & ADMIN_RESERVATION ) )
    {
        
cs_set_user_money(Player, ( cs_get_user_moneyPlayer ) + 1000));
        
ClientPrintColor(Player"^4[^3FrontLineD2^4]^1Because of his ^4VIP privileges^1, player ^3%s^1 is getting^4 1000$^1 bonus!"name)
        
    }



DeathOrAlive 09-10-2015 20:49

Re: [Help Req] Round Money
 
The code still doesn't give the money, neither prints the message. :(

P.S. I meant the first round of the map, when everybody has 800$.

wickedd 09-10-2015 20:50

Re: [Help Req] Round Money
 
Attach the .sma

DeathOrAlive 09-10-2015 20:59

Re: [Help Req] Round Money
 
1 Attachment(s)
Here it is :)

wickedd 09-10-2015 21:07

Re: [Help Req] Round Money
 
Start by reading this.

Then call public onSpawn( Player ) on round start.

P.S. The reason it's not working is because you never called onSpawn.

DeathOrAlive 09-10-2015 21:09

Re: [Help Req] Round Money
 
When I open the page it shows "404 Not Found"...

wickedd 09-10-2015 21:14

Re: [Help Req] Round Money
 
Oops. I posted the wrong link, try is now.

DeathOrAlive 09-10-2015 21:34

Re: [Help Req] Round Money
 
I read it like 5-6 times, but I still find it hard to see how exactly to repair my mistake and define the OnSpawn... :(

wickedd 09-10-2015 22:33

Re: [Help Req] Round Money
 
Search the forum or look at other plugins to learn how to do it.


All times are GMT -4. The time now is 22:17.

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