AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dynamic Native: Passing a string and an integer in the same parameter. (https://forums.alliedmods.net/showthread.php?t=277922)

BARRY. 01-20-2016 12:28

Dynamic Native: Passing a string and an integer in the same parameter.
 
Hi guys, I'm trying to pass a string and an integer on the same parameter. Was wondering if I've implemented this right.

Edit: If anybody else looking here's how I got it to work.

PHP Code:

native my_native_valueany:... )
register_native"my_native""_my_native", .style )

public 
_my_nativeiPluginiParams )

    if ( 
iParams != )
        return

    static 
bStringValueList = ( << ) | ( << ) | ( << )
 
    new 
iValue get_param
    new 
szBuffer32 
    new 
iInput
    
     
    
if ( ( << iValue ) & bStringValueList 
    { 
        
get_string2szBuffercharsmaxszBuffer ) )
    } 
    else
    {
        
iInput get_param_byref)
    }

    switch ( 
iValue 
    { 
        case 
1copyszMyString1charsmaxszMyString1 ), szBuffer 
        case 
2copyszMyString2charsmaxszMyString2 ), szBuffer 
        case 
3copyszMyString3charsmaxszMyString3 ), szBuffer 
        case 
4iVariable1 iInput 
        
case 5iVariable2 iInput 
        
case 6iVariable3 iInput 
    



addons_zz 01-20-2016 15:03

Re: Dynamic natives and vdformat
 
Have you wandered debug and see if it is doing as expected?


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

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