Skip to content

Commit dab54d6

Browse files
authored
Merge pull request #38 from Disinterpreter/develop
GetVehicleParamsSirenState and small fix with hash
2 parents 3ea2d52 + 03c88c7 commit dab54d6

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

amx/server/syscalls.lua

+20-2
Original file line numberDiff line numberDiff line change
@@ -2920,10 +2920,25 @@ end
29202920
-- Security
29212921

29222922
function SHA256_PassHash(amx, pass, salt, ret_hash, ret_hash_len)
2923-
local secret = hash ( 'sha256', salt .. '' .. pass )
2923+
local secret = hash ( 'sha256', pass .. '' .. salt ) -- who is it guy which writes salt after pass?
29242924
writeMemString(amx, ret_hash, string.upper(secret) )
29252925
end
29262926

2927+
-- Siren
2928+
2929+
function GetVehicleParamsSirenState(amx, vehicle)
2930+
local sirenstat = getVehicleSirensOn ( vehicle )
2931+
2932+
-- in samp this native returns 3 states
2933+
-- 1 - siren on
2934+
-- 0 - siren off
2935+
-- -1 - siren not exist, but we never get it.
2936+
if (sirenstat == true) then
2937+
return 1
2938+
else
2939+
return 0
2940+
end
2941+
end
29272942
-----------------------------------------------------
29282943
-- List of the functions and their argument types
29292944

@@ -3502,5 +3517,8 @@ g_SAMPSyscallPrototypes = {
35023517
SetActorVirtualWorld = {'y', 'i'},
35033518

35043519
-- security
3505-
SHA256_PassHash = {'s', 's', 'r', 'r'}
3520+
SHA256_PassHash = {'s', 's', 'r', 'i'},
3521+
3522+
-- siren
3523+
GetVehicleParamsSirenState = {'v'}
35063524
}

0 commit comments

Comments
 (0)