Skip to content

Commit

Permalink
add more dummies (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Disinterpreter authored Jun 29, 2020
1 parent f9eddcf commit d58ebc5
Show file tree
Hide file tree
Showing 6 changed files with 1,929 additions and 53 deletions.
1 change: 1 addition & 0 deletions amx/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<min_mta_version server="1.5.5-9.14060"></min_mta_version>

<script src="server/defines.lua" type="server" />
<script src="shared/anim_define.lua" type="shared" />
<script src="server/util.lua" type="server" />
<script src="server/_triggerqueue.lua" type="server" />
<script src="server/rcon.lua" type="server" />
Expand Down
3 changes: 3 additions & 0 deletions amx/server/natives/a_actors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ end

-- stub
function SetActorInvulnerable(amx)
notImplemented('SetActorInvulnerable')
return 1
end

-- stub
function IsActorInvulnerable(amx)
notImplemented('IsActorInvulnerable')
return 1
end

Expand All @@ -71,5 +73,6 @@ SetActorVirtualWorld = SetPlayerVirtualWorld

-- stub
function GetPlayerCameraTargetActor(amx)
notImplemented('GetPlayerCameraTargetActor')
return INVALID_ACTOR_ID
end
26 changes: 17 additions & 9 deletions amx/server/natives/a_objects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ function CreateObject(amx, model, x, y, z, rX, rY, rZ)
end

-- TODO: AttachObjectToVehicle dummy
function AttachObjectToVehicle(amx)
notImplemented('AttachObjectToVehicle')
end

function AttachObjectToObject(amx)
notImplemented('AttachObjectToObject')
Expand Down Expand Up @@ -56,7 +59,9 @@ function GetObjectModel(amx, object)
notImplemented('GetObjectModel')
end

-- SetObjectNoCameraCol
function SetObjectNoCameraCol(amx)
notImplemented('SetObjectNoCameraCol')
end

function IsValidObject(amx, objID)
return g_Objects[objID] ~= nil
Expand All @@ -77,7 +82,10 @@ end
function StopObject(amx, object)
stopObject(object)
end
-- IsObjectMoving

function IsObjectMoving(amx)
notImplemented('IsObjectMoving')
end

function CreatePlayerObject(amx, player, model, x, y, z, rX, rY, rZ)
outputConsole('CreatePlayerObject(' .. model .. ')')
Expand Down Expand Up @@ -201,18 +209,18 @@ function StopPlayerObject(amx, player, objID)
clientCall(player, 'StopPlayerObject', objID)
end

-- AttachPlayerObjectToPlayer client

-- native SetObjectMaterial(objectid, materialindex, modelid, txdname[], texturename[], materialcolor=0);
-- native SetPlayerObjectMaterial(playerid, objectid, materialindex, modelid, txdname[], texturename[], materialcolor=0);
function SetObjectMaterialText(amx)
notImplemented('SetObjectMaterialText')
end
-- AttachPlayerObjectToPlayer client

-- native SetObjectMaterialText(objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
-- native SetPlayerObjectMaterialText(playerid, objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);

-- native SetObjectsDefaultCameraCol(disable);
function SetObjectsDefaultCameraCol(amx, disable)
notImplemented('SetObjectsDefaultCameraCol')
end

function EditPlayerObject(amx, player, object)
--givePlayerMoney(player, amount)
notImplemented('EditPlayerObject')
end

Expand Down
152 changes: 121 additions & 31 deletions amx/server/natives/a_players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ function GetPlayerDrunkLevel(player)
return 0
end

-- TODO: SetPlayerDrunkLevel
function SetPlayerDrunkLevel(player)
notImplemented('SetPlayerDrunkLevel', 'SCM is not supported.')
return 0
end

function SetPlayerColor(amx, player, r, g, b)
setPlayerNametagColor(player, r, g, b)
Expand Down Expand Up @@ -255,6 +258,7 @@ end

-- dummy
function PlayCrimeReportForPlayer(amx, player, suspectid, crimeid)
notImplemented('PlayCrimeReportForPlayer')
return false
end

Expand All @@ -266,7 +270,10 @@ function StopAudioStreamForPlayer(amx, player)
clientCall(player, 'StopAudioStreamForPlayer')
end

-- TODO: SetPlayerShopName
function SetPlayerShopName(amx)
notImplemented('SetPlayerShopName')
return false
end

function SetPlayerSkillLevel(amx, player, skill, level)
return setPedStat(player, skill + 69, level)
Expand All @@ -284,7 +291,10 @@ function RemoveBuildingForPlayer(amx, player, model, x, y, z, radius)
clientCall(player, 'RemoveBuildingForPlayer', model, x, y, z, radius)
end

-- TODO: GetPlayerLastShotVectors dummy
function GetPlayerLastShotVectors(amx)
notImplemented('GetPlayerLastShotVectors')
return false
end

function SetPlayerAttachedObject(amx, player, index, modelid, bone, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, materialcolor1, materialcolor2)
local x, y, z = getElementPosition (player)
Expand Down Expand Up @@ -317,8 +327,15 @@ function RemovePlayerAttachedObject(amx, player, index)
return 0
end

-- TODO: dummy IsPlayerAttachedObjectSlotUsed
-- TODO: dummy EditAttachedObject
function IsPlayerAttachedObjectSlotUsed(amx)
notImplemented('IsPlayerAttachedObjectSlotUsed')
return false
end

function EditAttachedObject(amx)
notImplemented('EditAttachedObject')
return false
end

function CreatePlayerTextDraw(amx, player, x, y, text)
outputDebugString('CreatePlayerTextDraw called with args ' .. x .. ' ' .. y .. ' ' .. text)
Expand Down Expand Up @@ -440,6 +457,7 @@ function PlayerTextDrawSetOutline(amx, player, textdrawID, size)
return true
end
function PlayerTextDrawSetProportional(amx, player, textdrawID, proportional)
notImplemented('PlayerTextDrawSetProportional')
--TextDrawSetProportional(amx, textdraw, proportional)
end

Expand All @@ -458,9 +476,10 @@ function PlayerTextDrawFont(amx, player, textdrawID, font)
return true
end

-- TODO: dummy PlayerTextDrawFont
-- TODO: dummy PlayerTextDrawSetProportional
-- TODO: dummy PlayerTextDrawSetSelectable
function PlayerTextDrawSetSelectable(amx)
notImplemented('PlayerTextDrawSetSelectable')
return false
end

function PlayerTextDrawShow(amx, player, textdrawID)
if not IsPlayerTextDrawValid(player, textdrawID) then
Expand Down Expand Up @@ -495,9 +514,20 @@ function PlayerTextDrawSetString(amx, player, textdrawID, str)
return true
end

-- TODO: dummy PlayerTextDrawSetPreviewModel
-- TODO: dummy PlayerTextDrawSetPreviewRot
-- TODO: dummy PlayerTextDrawSetPreviewVehCol
function PlayerTextDrawSetPreviewModel(amx)
notImplemented('PlayerTextDrawSetPreviewModel')
return false
end

function PlayerTextDrawSetPreviewRot(amx)
notImplemented('PlayerTextDrawSetPreviewRot')
return false
end

function PlayerTextDrawSetPreviewVehCol(amx)
notImplemented('PlayerTextDrawSetPreviewVehCol')
return false
end

function GetPVarInt(amx, player, varname)
local value = g_Players[getElemID(player)].pvars[varname]
Expand Down Expand Up @@ -549,8 +579,16 @@ function DeletePVar(amx, player, varname)
return 1
end

-- TODO: dummy GetPVarsUpperIndex
-- TODO: dummy GetPVarNameAtIndex
function GetPVarsUpperIndex(amx)
notImplemented('GetPVarsUpperIndex')
return false
end

function GetPVarNameAtIndex(amx)
notImplemented('GetPVarNameAtIndex')
return false
end

function GetPVarType(amx, player, varname)
local value = g_Players[getElemID(player)].pvars[varname]
if value then
Expand Down Expand Up @@ -604,7 +642,7 @@ function TogglePlayerControllable(amx, player, enable)
end

function PlayerPlaySound(amx, player, soundID, x, y, z)
-- TODO: dummy
notImplemented('PlayerPlaySound')
end

function ApplyAnimation(amx, player, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync)
Expand All @@ -626,7 +664,10 @@ function GetPlayerAnimationIndex(player)
return 0
end

-- TODO: dummy GetAnimationName
function GetAnimationName(amx)
notImplemented('GetAnimationName')
return false
end

function GetPlayerSpecialAction(amx, player)
if doesPedHaveJetPack(player) then
Expand All @@ -648,7 +689,10 @@ function SetPlayerSpecialAction(amx, player, actionID)
g_Players[getElemID(player)].specialaction = actionID
end

-- TODO: dummy DisableRemoteVehicleCollisions
function DisableRemoteVehicleCollisions(amx)
notImplemented('DisableRemoteVehicleCollisions')
return false
end

function SetPlayerCheckpoint(amx, player, x, y, z, size)
g_Players[getElemID(player)].checkpoint = { x = x, y = y, z = z, radius = size }
Expand Down Expand Up @@ -720,20 +764,49 @@ function GetPlayerCameraMode(amx)
notImplemented('GetPlayerCameraMode')
end

-- TODO: EnablePlayerCameraTarget
function EnablePlayerCameraTarget(amx)
notImplemented('EnablePlayerCameraTarget')
return false
end

function GetPlayerCameraTargetObject(amx)
notImplemented('GetPlayerCameraTargetObject')
return false
end

function GetPlayerCameraTargetVehicle(amx)
notImplemented('GetPlayerCameraTargetVehicle')
return false
end

function GetPlayerCameraTargetPlayer(amx)
notImplemented('GetPlayerCameraTargetPlayer')
return false
end

-- native GetPlayerCameraTargetObject(playerid);
-- native GetPlayerCameraTargetVehicle(playerid);
-- native GetPlayerCameraTargetPlayer(playerid);
-- native GetPlayerCameraTargetActor(playerid);
-- GetPlayerCameraAspectRatio
-- GetPlayerCameraZoom
function GetPlayerCameraTargetActor(amx)
notImplemented('GetPlayerCameraTargetActor')
return false
end

function GetPlayerCameraAspectRatio(amx)
notImplemented('GetPlayerCameraAspectRatio')
return false
end

function GetPlayerCameraZoom(amx)
notImplemented('GetPlayerCameraZoom')
return false
end

function AttachCameraToObject(amx, player, object)
clientCall(player, 'AttachCameraToObject', object)
end

-- AttachCameraToPlayerObject
function AttachCameraToPlayerObject(amx)
notImplemented('AttachCameraToPlayerObject')
return false
end

--playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT
function InterpolateCameraPos(amx, player, FromX, FromY, FromZ, ToX, ToY, ToZ, time, cut)
Expand Down Expand Up @@ -781,14 +854,17 @@ function SetPlayerVirtualWorld(amx, player, dimension)
setElementDimension(player, dimension)
end

-- TODO: dummy GetPlayerVirtualWorld
function GetPlayerVirtualWorld(amx)
notImplemented('GetPlayerVirtualWorld')
return false
end

function EnableStuntBonusForAll(amx, enable)

notImplemented('EnableStuntBonusForAll')
end

function EnableStuntBonusForPlayer(amx, player, enable)

notImplemented('EnableStuntBonusForPlayer')
end

function TogglePlayerSpectating(amx, player, enable)
Expand Down Expand Up @@ -828,11 +904,25 @@ function PlayerSpectateVehicle(amx, player, vehicleToSpectate, mode)
end
end

-- native StartRecordingPlayerData(playerid, recordtype, recordname[]);
-- native StopRecordingPlayerData(playerid);
function StartRecordingPlayerData(amx)
notImplemented('StartRecordingPlayerData')
return false
end

function StopRecordingPlayerData(amx)
notImplemented('StopRecordingPlayerData')
return false
end

function SelectTextDraw(amx)
notImplemented('SelectTextDraw')
return false
end

-- native SelectTextDraw(playerid, hovercolor); // enables the mouse so the player can select a textdraw
-- native CancelSelectTextDraw(playerid); // cancel textdraw selection with the mouse
function CancelSelectTextDraw(amx)
notImplemented('CancelSelectTextDraw')
return false
end

-- Explosion
function CreateExplosionForPlayer(amx, player, x, y, z, type, radius)
Expand Down
Loading

0 comments on commit d58ebc5

Please sign in to comment.