[ASI] Get local nickname and split it ?

mistery

Well-known member
Joined
Apr 23, 2014
Messages
262
Reaction score
5
So I'm tryna get my nickname , split it in characters , then convert each character to int and make their math average.
I tried something but i'm not sure it works lul
Also , I'm not sure if the addresses are good , i found them on the forums
Any suggestions?

Code:
void test()
{
int i=0,s=0,c=0,m=0;
char* nick;
DWORD* SAMP_INFO = 0;
DWORD* pSAMP1 = 0;
DWORD* pSAMP2 = 0;
    Sleep(2000);
    DWORD SAMPDLLBASE = (DWORD)GetModuleHandleA("samp.dll");
        if(SAMPDLLBASE)
            {
                SAMP_INFO = (DWORD*)(SAMPDLLBASE + 0x21A0F8);
                pSAMP1 = (DWORD*)(SAMP_INFO+0x3CD);
                pSAMP2 = (DWORD*)(pSAMP1+0x18);
                nick = (char*)(pSAMP2 + 0xA);
            }

    for(i=0;i<=(int)strlen(nick);i++,c++)
    {
        s+=(int)nick[i];
    }
    m=s/c;
}
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
u can setup a list of the ABC

like A  = 1, B = 2, C = 3 to Z


then u can insert your characters into an another array
then just randomly pick the numbers from the array and bind it to an string

easily :)
 

mistery

Well-known member
Joined
Apr 23, 2014
Messages
262
Reaction score
5
Nah , i need to get actor's nickname , not generate random nickname..
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
You want to count a name's letters ( EG: Donald_Trump = 11 ) ? Something like that ?
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
mistery said:
split it in characters , then convert each character to int and make their math average.

math average????!?!?!?!?!!?!?
convert each character to int = ???


nosense? lol

i thought u want to mix word
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
user88 said:
mistery said:
split it in characters , then convert each character to int and make their math average.

math average????!?!?!?!?!!?!?
convert each character to int = ???


nosense? lol

i thought u want to mix word

I thought he means that he want to convert players name and then do some maths
Eg: There are 3 people in his stream
Big_Math = 7
Simple_Math = 10
Unsolved_Math = 12

Then 7 + 10 + 12 / 3 = 9.6666666666667
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Code:
              SAMP_INFO = (DWORD*)((char*)SAMPDLLBASE + 0x21A0F8);
              pSAMP1 = (DWORD*)((char*)(*SAMP_INFO) + 0x3CD);
              pSAMP2 = (DWORD*)((char*)(*pSAMP1) + 0x18);
              nick = (char*)((char*)(pSAMP2) + 0xA);

Should be something like this, (char*) is needed so it will increment offset correctly
 

mistery

Well-known member
Joined
Apr 23, 2014
Messages
262
Reaction score
5
_C1ph3r_ said:
You want to count a name's letters ( EG: Donald_Trump = 11 ) ? Something like that ?

if my nickname is ABCD , then i want to split it in characters , like A , B ,C , D
then
(int)'A' = 65
(int)B' = 66
(int)'C' = 67
(int)'D' = 68

(from here: https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html )

then make their sum : S = 65 + 66 + 67 + 68 = 266 and find average number by dividing the sum to the number of elements
so (int)266 / 4 = 66 (because there are 4 characters)

supahdupahnubah said:
Code:
              SAMP_INFO = (DWORD*)((char*)SAMPDLLBASE + 0x21A0F8);
              pSAMP1 = (DWORD*)((char*)(*SAMP_INFO) + 0x3CD);
              pSAMP2 = (DWORD*)((char*)(*pSAMP1) + 0x18);
              nick = (char*)((char*)(pSAMP2) + 0xA);

Should be something like this, (char*) is needed so it will increment offset correctly

hmm ok i'll try , but can u tell if the addresses are 037 ? bcuz i think they might be for 03z
 

mistery

Well-known member
Joined
Apr 23, 2014
Messages
262
Reaction score
5
it either crashes or returns a strange character like ◙╥
fffffuuuuu
 
Top