[HELP]save hex code to file?
#1

Hi. I want to ask, if is possible to export this hexcode:
Quote:

C2000000E0F108080400080094000000E40000001401000014 410000FFFFFFFF380000004000000048000000580000005800 00006000000008000000620000000000000070000000000000 00830000000000000088000000040000408E0000001F004F6E 52636F6E436F6D6D616E640043616C6C52656D6F746546756E 6374696F6E0073616D7000466C6F617400466C6F6174008078 002E8109290C27282700270C807B002C1081090B0130804F80 6E80528063806F806E8043806D806400807300

to file.
like using hexedit, but in samp (ongamemodeinit).
Reply
#2

What is it for?
Reply
#3

PHP код:
new len,
    
input[256 2],
    
output[256];
    
input "C2000000E0F108080400080094000000E40000001401000014";
len strlen(input) / 2;
HexStringToString(input,output,sizeof(output)); //Return binary data: "В...ŕń......”...д........"
new File:outf fopen("test.bin",io_write);
for(new 
0leni++){
    
fputchar(outf,output[i],false);
}
fclose(outf); 
ADM:
https://sampforum.blast.hk/showthread.php?tid=595203
Reply
#4

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
new len,
    
input[256 2],
    
output[256];
    
input "C2000000E0F108080400080094000000E40000001401000014";
len strlen(input) / 2;
HexStringToString(input,output,sizeof(output)); //Return binary data: "В...ŕń......”...д........"
new File:outf fopen("test.bin",io_write);
for(new 
0leni++){
    
fputchar(outf,output[i],false);
}
fclose(outf); 
ADM:
https://sampforum.blast.hk/showthread.php?tid=595203
Thanx.

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
What is it for?
I have OnRconCommand in my gamemode. but in samp there is some bug, and it is working only in fs.
so i want to create .amx file (filterscript) that will comunicate with my gm and make OnRconCommand working.
then i will just load this fs by using command in my gm.

file i want create:
Код:
#include <a_samp>
public OnRconCommand(cmd[])
{
CallRemoteFunction("OnRconCmd","s",cmd);
return 1;
}
hex value u can see in this thread is from compiled .amx.

then i can just use this in my gm:
Код:
//to ongamemodeinit:
SendRconCommand(loadfs ../scriptfiles/fix);  //fix will be name of created file


public OnRconCmd(cmd[])
{
    return 1;
}
forward OnRconCmd(cmd[]);
+ create file.
Reply
#5

Quote:
Originally Posted by gouster3
Посмотреть сообщение
I have OnRconCommand in my gamemode. but in samp there is some bug, and it is working only in fs.
so i want to create .amx file (filterscript) that will comunicate with my gm and make OnRconCommand working.
then i will just load this fs by using command in my gm.

file i want create:
Код:
#include <a_samp>
public OnRconCommand(cmd[])
{
CallRemoteFunction("OnRconCmd","s",cmd);
return 1;
}
hex value u can see in this thread is from compiled .amx.

then i can just use this in my gm:
Код:
//to ongamemodeinit:
SendRconCommand(loadfs ../scriptfiles/fix);  //fix will be name of created file


public OnRconCmd(cmd[])
{
    return 1;
}
forward OnRconCmd(cmd[]);
+ create file.
Why don't you simply load a filterscript with code:
pawn Код:
#define FILTERSCRIPT

#include <a_samp>

public OnRconCommand(cmd[])
{
    return 0;
}
and then use OnRconCommand callback normally to your gamemode?
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Why don't you simply load a filterscript with code:
pawn Код:
#define FILTERSCRIPT

#include <a_samp>

public OnRconCommand(cmd[])
{
    return 0;
}
and then use OnRconCommand callback normally to your gamemode?
Yes, it is simple, but i want to have all my gamemode in one file (gm.amx) in gamemodes folder. all other required files will be created from gamemode code automatic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)