AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bomb(defuser, planter) (https://forums.alliedmods.net/showthread.php?t=187905)

Waleed 06-19-2012 14:32

Bomb(defuser, planter)
 
PHP Code:

bomb_planting(planter)
bomb_explode planterdefuser 

What to type in "planter" or "defuser" or How to define "planter" or "defuser"?
I have searched the forums and also read "CS Bomb Scripting: http://forums.alliedmods.net/showthread.php?t=40164"
But,I couldn't find out what to type in there?

Any help would be very helpful!
Thanks,

Exolent[jNr] 06-19-2012 14:37

Re: Bomb(defuser, planter)
 
They are forwards, so you can define whatever variable you want them to be called.

Code:
#include <amxmodx> #include <csx> public bomb_planted( iPlanter ) {     new szName[ 32 ];     get_user_name( iPlanter, szName, charsmax( szName ) );         client_print( 0, print_center, "* %s planted the bomb!", szName ); }

Liverwiz 06-19-2012 14:39

Re: Bomb(defuser, planter)
 
Here is some of my code from a plugin i wrote.
Uses CSX's bomb_explode hook.

Code:
public bomb_explode(planter, defuser) {     if(g_bknuckles[planter] && get_pcvar_num(bombFrag_pcvar) == 1)         giveFrags(planter, 1, "BOMB_EXPLODE") }

Its quite similar to bomb_planting
The parameters are the IDs of the players, as described.

Aooka 06-19-2012 14:40

Re: Bomb(defuser, planter)
 
Quote:

Originally Posted by Exolent[jNr] (Post 1731813)
They are forwards, so you can define whatever variable you want them to be called.

Code:
#include <amxmodx> #include <csx> public bomb_planted( iPlanter ) {     new szName[ 32 ];     get_user_name( iPlanter, szName, charsmax( szName ) );         client_print( 0, print_center, "* %s planted the bomb!", szName ); }

Why they are a * here ?

Exolent[jNr] 06-19-2012 14:40

Re: Bomb(defuser, planter)
 
Quote:

Originally Posted by Aooka (Post 1731816)
Why they are a * here ?

Because I wanted it before the message.

Aooka 06-19-2012 14:45

Re: Bomb(defuser, planter)
 
Ah okay just for fun ^^

Waleed 06-20-2012 04:56

Re: Bomb(defuser, planter)
 
Quote:

Originally Posted by Exolent[jNr] (Post 1731813)
They are forwards, so you can define whatever variable you want them to be called.

Code:
#include <amxmodx> #include <csx> public bomb_planted( iPlanter ) {     new szName[ 32 ];     get_user_name( iPlanter, szName, charsmax( szName ) );         client_print( 0, print_center, "* %s planted the bomb!", szName ); }

Its not working!

OnePL 06-20-2012 05:04

Re: Bomb(defuser, planter)
 
Hm ?

PHP Code:

#include <amxmodx>

public bomb_defused(defuser) {
    new 
defuser_name[32]
    
get_user_name(defuserdefuser_namecharsmax(defuser_name))

    
client_print(0print_center"%s defused the bomb!"defuser_name)
}

public 
bomb_planted() {
    for (new 
1<= 33i++)
        if(
is_user_connected(i))
            
client_print(0print_chat"C4 has been planted!")



Aooka 06-20-2012 06:38

Re: Bomb(defuser, planter)
 
why they are a a loop "for" ? I do not understand ... :)
Thanks

EpicMonkey 06-20-2012 07:18

Re: Bomb(defuser, planter)
 
Quote:

Originally Posted by OnePL (Post 1732251)
Hm ?

PHP Code:

#include <amxmodx>

public bomb_defused(defuser) {
    new 
defuser_name[32]
    
get_user_name(defuserdefuser_namecharsmax(defuser_name))

    
client_print(0print_center"%s defused the bomb!"defuser_name)
}

public 
bomb_planted() {
    for (new 
1<= 33i++)
        if(
is_user_connected(i))
            
client_print(0print_chat"C4 has been planted!")



What your doing makes no sense at all , your looping through all the players ... and your not even using it , exolents method should work fine :3


All times are GMT -4. The time now is 06:09.

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