With this snippet, you can generate a fabricated name from a random online player in the server:
Player Name Spoofing is a method where in you Pretend to be other Player's Name. This type of trick is Mostly used to deceive other players that knows the target. There are many ways to Spoof nicknames.
Code:
:randomplayerspoofer // 0AB1: @randomplayerspoofer 1 _namebuffer 0@ // 0@ needs to have size >= 21
0C8B: samp 31@ = get_player_count streamed_only false
if 31@ <= 1
then
0B2B: samp 28@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 28@ = get_player_nickname 28@
0C13: strcpy destination 0@ source 28@
0AB1: @namespoofer 1 _namebuffer 0@
else
0C8A: samp 31@ = get_max_player_id streamed_only false
31@++
for 30@ = 1 to 100 // max of 100 retries
0209: 29@ = random_int_in_ranges 0 31@
if 0B23: samp is_player_connected 29@
then
0B36: samp 28@ = get_player_nickname 29@
0C13: strcpy destination 0@ source 28@
if 0AB1: @namespoofer 1 _namebuffer 0@
then break
end
end
end
end
ret 0
:namespoofer // 0AB1: @namespoofer 1 _namebuffer 0@ // 0@ must have the string name you want to spoof
// gate 0 ~ validity checking
0C17: 31@ = strlen 0@
if 31@ <= 0
then
059A: return_false
ret 0
else 0485: return_true
end
// gate 1 ~ I and l letter swap, this is the most deceiving name spoofing method
if or
0C2A: 27@ = strchr 0@ char 73 // "I"
0C2A: 27@ = strchr 0@ char 108 // "l"
then
if 0C2A: 26@ = strchr 0@ char 73 // "I"
then 0085: 27@ = 26@
else
if 0C2A: 26@ = strchr 0@ char 108 // "l"
then 0085: 27@ = 26@
end
end
0C17: 26@ = strlen 27@
while true
0209: 25@ = random_int_in_ranges 0 26@
005A: 25@ += 27@ // (int)
0A8D: 24@ = read_memory 25@ size 1 virtual_protect 0
if 24@ == 73 // ascii "I"
then
0A8C: write_memory 25@ size 1 value 108 virtual_protect 1 // change to letter "l"
break
else
if 24@ == 108 // ascii "l"
then
0A8C: write_memory 25@ size 1 value 73 virtual_protect 1 // change to letter "I"
break
end
end
end
ret 0
end
// the next stages changes one character on the name, that means it has a "deception effectiveness percentage = 100 - (100/strlen(name))". Example having a name length of 10 characters gives a deception effectiveness of 90.0% though the human eye...
// gate 2 ~ numerical changer
if 0C2B: 27@ = strpbrk string 0@ control "0123456789" // if a number exist
then
0C17: 26@ = strlen 27@
while true
0209: 25@ = random_int_in_ranges 0 26@
005A: 25@ += 27@ // (int)
0A8D: 24@ = read_memory 25@ size 1 virtual_protect 0
if and // is a numerical character
24@ >= 48
24@ <= 57
then
while true
0209: 23@ = random_int_in_ranges 48 58
if 803B: not 23@ == 24@ // (int)
then break
end
end
0A8C: write_memory 25@ size 1 value 23@ virtual_protect 1
break
end
end
ret 0
end
// gate 3 ~ consonant changer
0C2E: 27@ = strspn string1 0@ string2 "aeiouAEIOU[]._" // search for consonant
if 001D: 31@ > 27@ // if a consonant exist
then
005A: 27@ += 0@ // pointer of consonant first-hit
0C17: 26@ = strlen 27@
while true
0209: 25@ = random_int_in_ranges 0 26@
005A: 25@ += 27@ // (int)
0A8D: 24@ = read_memory 25@ size 1 virtual_protect 0
if 0AB1: @isalphacharacter 3 _character 24@ _mode 1 _case 0
then
if and // is uppercase
24@ >= 65
24@ <= 90
then 0AB1: @randomalphacharacter 2 _mode 1 _case 2 _ignorechar 24@ _storecharacter 24@
else 0AB1: @randomalphacharacter 2 _mode 1 _case 1 _ignorechar 24@ _storecharacter 24@
end
0A8C: write_memory 25@ size 1 value 24@ virtual_protect 1
break
end
end
ret 0
end
// gate 4 ~ vowel changer
if 0C2B: 27@ = strpbrk string 0@ control "aeiouAEIOU" // if a vowel exist
then
0C17: 26@ = strlen 27@
while true
0209: 25@ = random_int_in_ranges 0 26@
005A: 25@ += 27@ // (int)
0A8D: 24@ = read_memory 25@ size 1 virtual_protect 0
if 0AB1: @isalphacharacter 3 _character 24@ _mode 2 _case 0
then
if and // is uppercase
24@ >= 65
24@ <= 90
then 0AB1: @randomalphacharacter 2 _mode 2 _case 2 _ignorechar 24@ _storecharacter 24@
else 0AB1: @randomalphacharacter 2 _mode 2 _case 1 _ignorechar 24@ _storecharacter 24@
end
0A8C: write_memory 25@ size 1 value 24@ virtual_protect 1
break
end
end
ret 0
end
// gate 5 ~ FORCE a random character to change into a special character
0209: 25@ = random_int_in_ranges 0 31@
005A: 25@ += 0@ // (int)
0A8D: 24@ = read_memory 25@ size 1 virtual_protect 0
while true
0209: 27@ = random_int_in_ranges 48 123
if 803B: not 24@ == 27@ // not same characters
then
if or
27@ <= 57
27@ >= 97
then break
else
if and
27@ >= 65
27@ <= 90
then break
end
end
end
end
0A8C: write_memory 25@ size 1 value 27@ virtual_protect 1
ret 0
:randomalphacharacter
{
Usage: 0AB1: @randomalphacharacter 2 _mode 0@ _case 1@ _ignorechar 2@ _storecharacter 29@
Mode: 0@ ~ 1 = consonants only ~ 2 = vowels only ~ else = all alpha characters
Case: 1@ ~ 1 = lowercase only ~ 2 = uppercase only ~ else = case insensitive
}
if 1@ == 1
then 31@ = 97 // start of lowercase
else 31@ = 65 // start of uppercase
end
if 1@ == 2
then 30@ = 91 // 90+1 // end of uppercase + extra 1 for randomizing
else 30@ = 123 // 122+1 // end of lowercase + extra 1 for randomizing
end
while true
0209: 29@ = random_int_in_ranges 31@ 30@
if 803B: not 29@ == 2@ // not ignored character
then
if 0AB1: @isalphacharacter 3 _character 29@ _mode 0@ _case 1@
then break
end
end
end
ret 1 29@
:isalphacharacter
{
Usage: if 0AB1: @isalphacharacter 3 _character 0@ _mode 1@ _case 2@
Char: 0@ ~ the ascii number to be examined
Mode: 1@ ~ 1 = consonants only ~ 2 = vowels only ~ else = all alpha characters
Case: 2@ ~ 1 = lowercase only ~ 2 = uppercase only ~ else = case insensitive
}
if 2@ == 1
then 31@ = 97 // start of lowercase
else 31@ = 65 // start of uppercase
end
if 2@ == 2
then 30@ = 90 // end of uppercase
else 30@ = 122 // end of lowercase
end
if and // within the alphacharacter case boundaries
002D: 0@ >= 31@ // (int)
002D: 30@ >= 0@ // (int)
then
if or
0@ <= 90 // within uppercase barrier
0@ >= 97 // within lowercase barrier
then
if 1@ == 1 // consonants only
then
if and
0@ <> 65 // A
0@ <> 69 // E
0@ <> 73 // I
0@ <> 79 // O
0@ <> 85 // U
then
if and
0@ <> 97 // a
0@ <> 101 // e
0@ <> 105 // i
0@ <> 111 // o
0@ <> 117 // u
then
0485: return_true
ret 0
end
end
else
if 1@ == 2 // vowels only
then
if or
0@ == 65 // A
0@ == 69 // E
0@ == 73 // I
0@ == 79 // O
0@ == 85 // U
then
0485: return_true
ret 0
else
if or
0@ == 97 // a
0@ == 101 // e
0@ == 105 // i
0@ == 111 // o
0@ == 117 // u
then
0485: return_true
ret 0
end
end
else // if all alpha characters are allowed
0485: return_true
ret 0
end
end
end
end
059A: return_false
ret 0
Player Name Spoofing is a method where in you Pretend to be other Player's Name. This type of trick is Mostly used to deceive other players that knows the target. There are many ways to Spoof nicknames.
- Interchanging letter "l or small L" and "I or big i" on player names. Can you tell the difference between letters "l and I" in SAMP? The Deception percentage is 100%.
- The Respective list have a Deception percentage of 100(n-(1/n))% where "n" is the length on the target nickname. So having a namelength of 10 will have a deception percentage of 90%
- Dot(.) Name Addition - adding extra dot at the beggining or at the end of the name.
- Numerical Changer - changing numbers from 0-9 within the name into another number.
- Single Consonant Manipulation - changing a consonant into a nearer copy of itself, like "f and t" / "n and m"
- Single Vowel Changer - changing a single vowel into another vowel.
Code:
{$CLEO .cs}
0000: prints a spoofed name from a random player
const
BUFFER = 0@
end
alloc BUFFER 21 // Buffer names must have a size of 21 above
while true
wait 1000
0AB1: @randomplayerspoofer 1 _namebuffer BUFFER
0ACD: show_text_highpriority 0@ time 1000
end