Raised This Month: $51 Target: $400
 12% 

RequestFrame Function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 02-11-2018 , 15:17   RequestFrame Function
Reply With Quote #1

Is it possible to pass a char array through the second argument of this funcion?

According to this, I should be able to pass any type of data. but whe I try to pass a char array, it just gives me "argument type mismatch (argument 2)"

Thankyou.
lugui is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 02-11-2018 , 15:40   Re: RequestFrame Function
Reply With Quote #2

Use Datapacks:

PHP Code:
void somefunction()
{
    
DataPack data = new Datapack();
    
RequestFrame(FrameCallbackdata);
    
data.WriteString("blahh");
}

public 
void FrameCallback(any data)
{
    
ResetPack(data);
    
char buffer[64];
    
ReadPackString(databuffersizeof(buffer));
    
delete view_as<DataPack>(data);
     
    
// Your code...

brunoronning is offline
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 02-11-2018 , 15:55   Re: RequestFrame Function
Reply With Quote #3

Thankyou. Also, how can I request a frame for a function that does not have any argument?
lugui is offline
SZOKOZ
Member
Join Date: Jan 2014
Old 02-11-2018 , 17:00   Re: RequestFrame Function
Reply With Quote #4

One thing to point out is that a request frame will take any value as an argument. You tried to pass an array and that's why it didn't work. If it took any array as an argument then you could pass char arrays to it. Pay attention to this in the future. "any" is different from "any[]".
By default the data argument is 0 so you don't need to pass anything to the data parameter if you don't have anything to pass to it. Just omit it. RequestFrame(FrameCallback);
__________________
May still be available for SM scripting. Just look at my Steam profile regarding my availability.
My Steam

Last edited by SZOKOZ; 02-11-2018 at 17:02.
SZOKOZ is offline
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 02-11-2018 , 17:04   Re: RequestFrame Function
Reply With Quote #5

Thx
lugui 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 15:47.


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