Raised This Month: $ Target: $400
 0% 

type mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cstrike37
Member
Join Date: Jan 2012
Old 04-22-2013 , 21:21   type mismatch
Reply With Quote #1

I keep getting this error when compiling, it's kinda getting annoying now.
PHP Code:
error 035argument type mismatch <argument 4
Can someone help me how to fix it?

PHP Code:
public DeathMsg()
{
    new 
kid read_data(1)
    new 
vid read_data(2)
    
    if( 
kid == vid )
        return 
PLUGIN_CONTINUE;
    if( !
g_bIsVipvid ] )
        return 
PLUGIN_CONTINUE;
    new 
pnumplayers[32]
    
get_playersplayerspnum )
    for( new 
itidpnumi++ )
    {
        
tid players[i]
        
emit_sound(tidCHAN_VOICE"spk %s",die_spk[random(2)], VOL_NORMATTN_NORM0PITCH_NORM)
    }

    return 
PLUGIN_CONTINUE;

cstrike37 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-22-2013 , 21:47   Re: type mismatch
Reply With Quote #2

die_spk[random(2)] ??

Its not a random(SOME_TAG) ??

For best help post the full code
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-23-2013 , 00:15   Re: type mismatch
Reply With Quote #3

PHP Code:
        tid players[i]
        
emit_sound(tidCHAN_VOICE"spk %s",die_spk[random(2)], VOL_NORMATTN_NORM0PITCH_NORM
->

PHP Code:
        emit_sound(players[i], CHAN_VOICEdie_spk[random(2)], VOL_NORMATTN_NORM0PITCH_NORM
-don't need to cache players[i] in a var if you use it once.
-you can't format a string in emit_sound native, pass directly the sound name because you don't need spk command (your problem was there).
-last, you may want to add "a" flag to get_players so you only retrieve a list of alive players.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
cstrike37
Member
Join Date: Jan 2012
Old 04-24-2013 , 00:44   Re: type mismatch
Reply With Quote #4

Alright thanks!
And is there a way to make only the close player hear the sound?
When hes near the person that got killed he will hear the death sound (like 2000 radius away)
cstrike37 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 10:48.


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