Skip to content

GetVehicleParamsSirenState and small fix with hash #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions amx/server/syscalls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2920,10 +2920,25 @@ end
-- Security

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

-- Siren

function GetVehicleParamsSirenState(amx, vehicle)
local sirenstat = getVehicleSirensOn ( vehicle )

-- in samp this native returns 3 states
-- 1 - siren on
-- 0 - siren off
-- -1 - siren not exist, but we never get it.
if (sirenstat == true) then
return 1
else
return 0
end
end
-----------------------------------------------------
-- List of the functions and their argument types

Expand Down Expand Up @@ -3502,5 +3517,8 @@ g_SAMPSyscallPrototypes = {
SetActorVirtualWorld = {'y', 'i'},

-- security
SHA256_PassHash = {'s', 's', 'r', 'r'}
SHA256_PassHash = {'s', 's', 'r', 'i'},

-- siren
GetVehicleParamsSirenState = {'v'}
}