Plugin Functions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
GetServerVersion(void);
GetServerSettings(ServerSettings* pstSettings);
ExportFunctions(int nPluginId, void** ppFunctionList, unsigned int uSize);
GetNumberOfPlugins(void);
GetPluginInfo(int nPluginId, PluginInfo* pstPluginInfo);
FindPlugin(char* pszPluginName);
GetPluginExports(int nPluginId, unsigned int* puSize);
GetTime(uint64_t* pullTime);

//MESSAGES
printf(const char* pszFormat, ...);
SendCustomCommand(unsigned int uCmdType, const char* pszFormat, ...);
SendClientMessage(int nPlayerId, unsigned int uColour, const char* pszFormat, ...);
SendGameMessage(int nPlayerId, int nType, const char* pszFormat, ... );

//SERVER SETTINGS
SetServerName(const char* pszText);
GetServerName(char* pszBuffer, int nBufferLen);
SetMaxPlayers(int nMaxPlayers);
GetMaxPlayers(void);
SetServerPassword(char* pszBuffer);
GetServerPassword(char* pszBuffer, int nBufferLen);
SetGameModeText(const char* pszText);
GetGameModeText(char* pszBuffer, int nBufferLen);

//WORLD: settings
SetWorldBounds(float fMaxX, float fMinX, float fMaxY, float fMinY);
GetWorldBounds(float* pfMaxX, float* pfMinX, float* pfMaxY, float* pfMinY);
SetWastedSettings(unsigned int dwDeathTimer, unsigned int dwFadeTimer, float fFadeInSpeed, float fFadeOutSpeed, unsigned int dwFadeColour, unsigned int dwCorpseFadeStart, unsigned int dwCorpseFadeTime);
GetWastedSettings(unsigned int* pdwDeathTimer, unsigned int* pdwFadeTimer, float* pfFadeInSpeed, float* pfFadeOutSpeed, unsigned int* pdwFadeColour, unsigned int* pdwCorpseFadeStart, unsigned int* pdwCorpseFadeTime);
SetTimeRate(unsigned int uTimeRate);
GetTimeRate(void);
SetHour(int nHour);
GetHour(void);
SetMinute(int nMinute);
GetMinute(void);
SetWeather(int nWeather);
GetWeather(void);
SetGravity(float fGravity);
GetGravity(void);
SetGamespeed(float fGamespeed);
GetGamespeed(void);
SetWaterLevel(float fWaterLevel);
GetWaterLevel(void);
SetMaxHeight(float fHeight);
GetMaxHeight(void);
SetKillCmdDelay(int nDelay);
GetKillCmdDelay(void);
SetVehiclesForcedRespawnHeight(float fHeight);
GetVehiclesForcedRespawnHeight(void);

//WORLD: toggles
ToggleSyncFrameLimiter(unsigned int bToggle);
EnabledSyncFrameLimiter(void);
ToggleFrameLimiter(unsigned int bToggle);
EnabledFrameLimiter(void);
ToggleTaxiBoostJump(unsigned int bToggle);
EnabledTaxiBoostJump(void);
ToggleDriveOnWater(unsigned int bToggle);
EnabledDriveOnWater(void);
ToggleFastSwitch(unsigned int bToggle);
EnabledFastSwitch(void);
ToggleFriendlyFire(unsigned int bToggle);
EnabledFriendlyFire(void);
ToggleDisableDriveby(unsigned int bToggle);
EnabledDisableDriveby(void);
TogglePerfectHandling(unsigned int bToggle);
EnabledPerfectHandling(void);
ToggleFlyingCars(unsigned int bToggle);
EnabledFlyingCars(void);
ToggleJumpSwitch(unsigned int bToggle);
EnabledJumpSwitch(void);
ToggleShowMarkers(unsigned int bToggle);
EnabledShowMarkers(void);
ToggleStuntBike(unsigned int bToggle);
EnabledStuntBike(void);
ToggleShootInAir(unsigned int bToggle);
EnabledShootInAir(void);
ToggleShowNametags(unsigned int bToggle);
EnabledShowNametags(void);
ToggleJoinMessages(unsigned int bToggle);
EnabledJoinMessages(void);
ToggleDeathMessages(unsigned int bToggle);
EnabledDeathMessages(void);
ToggleChatTagsByDefaultEnabled(unsigned int bToggle);
EnabledChatTagsByDefault(void);

//MISC
CreateExplosion(int nWorldId, int nType, float fPosX, float fPosY, float fPosZ, int nSourcePlayerId, unsigned int bGroundLevel);
PlaySound(int nWorldId, int nSoundId, float fPosX, float fPosY, float fPosZ);
HideMapObject(int nModelId, int nTenthX, int nTenthY, int nTenthZ);
ShowMapObject(int nModelId, int nTenthX, int nTenthY, int nTenthZ);
ShowAllMapObjects(void);

//WEAPONDATA
SetWeaponDataValue(int nWeaponId, int nFieldId, double fValue);
GetWeaponDataValue(int nWeaponId, int nFieldId);
ResetWeaponDataValue(int nWeaponId, int nFieldId);
IsWeaponDataValueModified(int nWeaponId, int nFieldId);
ResetWeaponData(int nWeaponId);
ResetAllWeaponData(void);

//KEYBINDS
GetKeyBindUnusedSlot(void);
GetKeyBindData(int nBindId, unsigned int* pbOnRelease, int* nKeyOne, int* pnKeyTwo, int* pnKeyThree);
RegisterKeyBind(int nBindId, unsigned int bOnRelease, int nKeyOne, int nKeyTwo, int nKeyThree);
RemoveKeyBind(int nBindId);
RemoveAllKeyBinds(void);

//BLIPS
CreateCoordBlip(int nIndex, int nWorld, float fX, float fY, float fZ, int nScale, unsigned int uColour, int nSprite);
DestroyCoordBlip(int nIndex);
GetCoordBlipInfo(int nIndex, int* pnWorld, float* pfX, float* pfY, float* pfZ, int* pnScale, unsigned int* puColour, int* pnSprite);

//SPRITES
CreateSprite(int nIndex, const char * pszFilename, int fX, int fY, int fRotX, int fRotY, float fRotation, unsigned char byAlpha);
DestroySprite(int nIndex);
ShowSprite(int nIndex, int nPlayerId);
HideSprite(int nIndex, int nPlayerId);
MoveSprite(int nIndex, int nPlayerId, unsigned int fX, unsigned int fY);
SetSpriteCenter(int nIndex, int nPlayerId, unsigned int fX, unsigned int fY);
RotateSprite(int nIndex, int nPlayerId, float fRotation);
SetSpriteAlpha(int nIndex, int nPlayerId, unsigned char byAlpha);

//TEXTDRAWS
CreateTextdraw(int nIndex, const char * pszText, int lX, int lY, unsigned int dwColour);
DestroyTextdraw(int nIndex);
ShowTextdraw(int nIndex, int nPlayerId);
HideTextdraw(int nIndex, int nPlayerId);
MoveTextdraw(int nIndex, int nPlayerId, int lX, int lY);
SetTextdrawColour(int nIndex, int nPlayerId, unsigned int dwColour);

//RADIOS
AddRadioStream(int nRadioId, const char* pszRadioName, const char* pszRadioURL, unsigned int bIsListed);
RemoveRadioStream(int nRadioId);

//CLASSES
SetUseClasses(unsigned int bToggle);
GetUseClasses(void);
GetPlayerClass(int nPlayerId);
AddPlayerClass(int nTeamId, unsigned int uColour, int nModelId, float fSpawnX, float fSpawnY, float fSpawnZ, float fAngleZ, int nWep1, int nWep1Ammo, int nWep2, int nWep2Ammo, int nWep3, int nWep3Ammo);
SetSpawnPlayerPos(float fPosX, float fPosY, float fPosZ);
SetSpawnCameraPos(float fPosX, float fPosY, float fPosZ);
SetSpawnCameraLookAt(float fPosX, float fPosY, float fPosZ);

//ADMIN
IsPlayerAdmin(int nPlayerId);
SetPlayerAdmin(int nPlayerId, unsigned int bToggle);
GetPlayerIP(int nPlayerId, char* pszBuffer, int nBufferLen);
KickPlayer(int nPlayerId);
BanPlayer(int nPlayerId);
BanIP(char* pszIPAddress);
UnbanIP(char* pszIPAddress);
IsIPBanned(char* pszIPAddress);

//PLAYERS: basic
GetPlayerIDFromName(char* pszName);
IsPlayerConnected(int nPlayerId);
IsPlayerSpawned(int nPlayerId);
IsPlayerStreamedForPlayer(int nCheckPlayer, int nPlayerId);
GetPlayerKey(int nPlayerId);
SetPlayerWorld(int nPlayerId, int nWorld);
GetPlayerWorld(int nPlayerId);
SetPlayerSecWorld(int nPlayerId, int nSecWorld);
GetPlayerSecWorld(int nPlayerId);
GetPlayerUniqueWorld(int nPlayerId);
IsPlayerWorldCompatible(int nPlayerId, int nWorld);
GetPlayerState(int nPlayerId);
GetPlayerName(int nPlayerId, char* szBuffer, int nBufferLen);
SetPlayerName(int nPlayerId, const char* pszName);
SetPlayerTeam(int nPlayerId, int nTeamId);
GetPlayerTeam(int nPlayerId);
SetPlayerSkin(int nPlayerId, int nSkinId);
GetPlayerSkin(int nPlayerId);
SetPlayerColour(int nPlayerId, unsigned int uColour);
GetPlayerColour(int nPlayerId);
ForcePlayerSpawn(int nPlayerId);
ForcePlayerSelect(int nPlayerId);
ForceAllSelect(void);

//PLAYERS: score, ping, money, typing
GivePlayerMoney(int nPlayerId, int nAmount);
SetPlayerMoney(int nPlayerId, int nAmount);
GetPlayerMoney(int nPlayerId);
SetPlayerScore(int nPlayerId, int nScore);
GetPlayerScore(int nPlayerId);
GetPlayerPing(int nPlayerId);
IsPlayerTyping(int nPlayerId);
GetPlayerFPS(int nPlayerId);
GetPlayerUID(int nPlayerId, char* szBuffer, int nBufferLen);

//PLAYERS: health and location
SetPlayerHealth(int nPlayerId, float fHealth);
GetPlayerHealth(int nPlayerId);
SetPlayerArmour(int nPlayerId, float fArmour);
GetPlayerArmour(int nPlayerId);
SetPlayerImmunityFlags(int nPlayerId, int nFlags);
GetPlayerImmunityFlags(int nPlayerId);
SetPlayerPos(int nPlayerId, float fPosX, float fPosY, float fPosZ);
GetPlayerPos(int nPlayerId, float* pfPosX, float* pfPosY, float* pfPosZ);
SetPlayerSpeed(int nPlayerId, float fSpeedX, float fSpeedY, float fSpeedZ);
GetPlayerSpeed(int nPlayerId, float* pfSpeedX, float* pfSpeedY, float* pfSpeedZ);
AddPlayerSpeed(int nPlayerId, float fSpeedX, float fSpeedY, float fSpeedZ);
SetPlayerHeading(int nPlayerId, float fAngleZ);
GetPlayerHeading(int nPlayerId);
SetPlayerAlpha(int nPlayerId, int nAlpha, int nFadeTime);
GetPlayerAlpha(int nPlayerId);

//PLAYERS: vehicle
PutPlayerInVehicle(int nPlayerId, int nVehicleId, int nSlot, unsigned int bMakeRoom, unsigned int bWarp);
RemovePlayerFromVehicle(int nPlayerId);
GetPlayerInVehicleStatus(int nPlayerId);
GetPlayerInVehicleSlot(int nPlayerId);
GetPlayerVehicleID(int nPlayerId);

//PLAYERS: toggles
TogglePlayerControllable(int nPlayerId, unsigned int bToggle);
EnabledPlayerControllable(int nPlayerId);
TogglePlayerDriveby(int nPlayerId, unsigned int bToggle);
EnabledPlayerDriveby(int nPlayerId);
TogglePlayerWhiteScanlines(int nPlayerId, unsigned int bToggle);
EnabledPlayerWhiteScanlines(int nPlayerId);
TogglePlayerGreenScanlines(int nPlayerId, unsigned int bToggle);
EnabledPlayerGreenScanlines(int nPlayerId);
TogglePlayerWidescreen(int nPlayerId, unsigned int bToggle);
EnabledPlayerWidescreen(int nPlayerId);
TogglePlayerShowMarkers(int nPlayerId, unsigned int bToggle);
EnabledPlayerShowMarkers(int nPlayerId);
TogglePlayerAttackPriv(int nPlayerId, unsigned int bToggle);
EnabledPlayerAttackPriv(int nPlayerId);
TogglePlayerHasMarker(int nPlayerId, unsigned int bToggle);
EnabledPlayerHasMarker(int nPlayerId);
TogglePlayerChatTagsEnabled(int nPlayerId, unsigned int bToggle);
EnabledPlayerChatTags(int nPlayerId);
TogglePlayerDrunkEffects(int nPlayerId, unsigned int bToggle);
EnabledPlayerDrunkEffects(int nPlayerId);

//PLAYERS: weapons
GivePlayerWeapon(int nPlayerId, int nWeaponId, int nAmmo);
SetPlayerWeapon(int nPlayerId, int nWeaponId, int nAmmo);
GetPlayerWeapon(int nPlayerId);
GetPlayerWeaponAmmo(int nPlayerId);
SetPlayerWeaponSlot(int nPlayerId, int nSlot);
GetPlayerWeaponSlot(int nPlayerId);
GetPlayerWeaponAtSlot(int nPlayerId, int nSlot);
GetPlayerAmmoAtSlot(int nPlayerId, int nSlot);
RemovePlayerWeapon(int nPlayerId, int nWeaponId);
RemoveAllWeapons(int nPlayerId);
//PLAYERS: camera
SetCameraPosition(int nPlayerId, float fPosX, float fPosY, float fPosZ, float fLookX, float fLookY, float fLookZ);
RestoreCamera(int nPlayerId);
IsCameraLocked(int nPlayerId);

//PLAYERS: misc
SetPlayerAnimation(int nPlayerId, int nGroupId, int nAnimationId);
SetPlayerWantedLevel(int nPlayerId, int nLevel);
GetPlayerStandingOnVehicle(int nPlayerId);
GetPlayerStandingOnObject(int nPlayerId);
IsPlayerAway(int nPlayerId);
GetPlayerSpectateTarget(int nPlayerId);
SetPlayerSpectateTarget(int nPlayerId, int nTargetId);

//VEHICLES
CreateVehicle(int nModelId, int nWorld, float fPosX, float fPosY, float fPosZ, float fAngleZ, int nColour1, int nColour2);
DeleteVehicle(int nVehicleId);
GetVehicleSyncSource(int nVehicleId);
GetVehicleSyncType(int nVehicleId);
IsVehicleStreamedForPlayer(int nVehicleId, int nPlayerId);
SetVehicleWorld(int nVehicleId, int nWorld);
GetVehicleWorld(int nVehicleId);
GetVehicleModel(int nVehicleId);
GetVehicleOccupant(int nVehicleId, int nSlotIndex);
RespawnVehicle(int nVehicleId);
SetVehicleImmunityFlags(int nVehicleId, int nImmuFlags);
GetVehicleImmunityFlags(int nVehicleId);
KillVehicle(int nVehicleId);
IsVehicleWrecked(int nVehicleId);
SetVehiclePos(int nVehicleId, float fPosX, float fPosY, float fPosZ, unsigned int bRemoveOccupants);
GetVehiclePos(int nVehicleId, float* pfPosX, float* pfPosY, float* pfPosZ);
SetVehicleRot(int nVehicleId, float fX, float fY, float fZ, float fW);
SetVehicleRotEuler(int nVehicleId, float fX, float fY, float fZ);
GetVehicleRot(int nVehicleId, float* pfX, float* pfY, float *pfZ, float *pfW);
GetVehicleRotEuler(int nVehicleId, float* pfX, float* pfY, float *pfZ);
SetVehicleSpeed(int nVehicleId, float fX, float fY, float fZ);
GetVehicleSpeed(int nVehicleId, float* pfX, float* pfY, float* pfZ);
AddVehicleSpeed(int nVehicleId, float fX, float fY, float fZ);
SetVehicleRelSpeed(int nVehicleId, float fX, float fY, float fZ);
GetVehicleRelSpeed(int nVehicleId, float* pfX, float* pfY, float* pfZ);
AddVehicleRelSpeed(int nVehicleId, float fX, float fY, float fZ);
SetVehicleTurnSpeed(int nVehicleId, float fX, float fY, float fZ);
GetVehicleTurnSpeed(int nVehicleId, float* pfX, float* pfY, float* pfZ);
AddVehicleTurnSpeed(int nVehicleId, float fX, float fY, float fZ);
SetVehicleRelTurnSpeed(int nVehicleId, float fX, float fY, float fZ);
GetVehicleRelTurnSpeed(int nVehicleId, float* pfX, float* pfY, float* pfZ);
AddVehicleRelTurnSpeed(int nVehicleId, float fX, float fY, float fZ);
SetVehicleSpawnPos(int nVehicleId, float fPosX, float fPosY, float fPosZ, float fAngleZ);
GetVehicleSpawnPos(int nVehicleId, float* pfPosX, float* pfPosY, float* pfPosZ, float* pfAngleZ);
SetVehicleSpawnRot(int nVehicleId, float fX, float fY, float fZ, float fW);
SetVehicleSpawnRotEuler(int nVehicleId, float fX, float fY, float fZ);
GetVehicleSpawnRot(int nVehicleId, float* pfX, float* pfY, float* pfZ, float* pfW);
GetVehicleSpawnRotEuler(int nVehicleId, float* pfX, float* pfY, float* pfZ);
SetVehicleIdleRespawnTimer(int nVehicleId, unsigned int uTimer);
GetVehicleIdleRespawnTimer(int nVehicleId);
SetVehicleHealth(int nVehicleId, float fHealth);
GetVehicleHealth(int nVehicleId);
SetVehicleColour(int nVehicleId, int nColour1, int nColour2);
GetVehicleColour(int nVehicleId, int* pnColour1, int* pnColour2);
SetVehicleDoorsLocked(int nVehicleId, unsigned int bToggle);
GetVehicleDoorsLocked(int nVehicleId);
SetVehiclePartStatus(int nVehicleId, int nPartId, int nStatus);
GetVehiclePartStatus(int nVehicleId, int nPartId);
SetVehicleTyreStatus(int nVehicleId, int nTyreId, int nStatus);
GetVehicleTyreStatus(int nVehicleId, int nTyreId);
SetVehicleDamageData(int nVehicleId, unsigned int uDamageData);
GetVehicleDamageData(int nVehicleId);
SetVehicleAlarm(int nVehicleId, unsigned int bToggle);
GetVehicleAlarm(int nVehicleId);
SetVehicleLights(int nVehicleId, unsigned int bToggle);
GetVehicleLights(int nVehicleId);
SetVehicleRadio(int nVehicleId, int nRadioId);
GetVehicleRadio(int nVehicleId);
SetVehicleRadioLocked(int nVehicleId, unsigned int bToggle);
IsVehicleRadioLocked(int nVehicleId);
GetVehicleGhostState(int nVehicleId);
SetVehicleGhostState(int nVehicleId, unsigned int bToggle);

//VEHICLES: handling
ResetAllVehicleHandlings(void);
ExistsHandlingRule(int nModelIndex, int nRuleIndex);
SetHandlingRule(int nModelIndex, int nRuleIndex, double fValue);
GetHandlingRule(int nModelIndex, int nRuleIndex);
ResetHandlingRule(int nModelIndex, int nRuleIndex);
ResetHandling(int nModelIndex);
ExistsInstHandlingRule(int nVehicleId, int nRuleIndex);
SetInstHandlingRule(int nVehicleId, int nRuleIndex, double fValue);
GetInstHandlingRule(int nVehicleId, int nRuleIndex);
ResetInstHandlingRule(int nVehicleId, int nRuleIndex);
ResetInstHandling(int nVehicleId);

//PICKUPS
CreatePickup(int nModel, int nWorld, int nQuantity, float fPosX, float fPosY, float fPosZ, int nAlpha, unsigned int bAutomatic);
DeletePickup(int nPickupId);
IsPickupStreamedForPlayer(int nPickupId, int nPlayerId);
SetPickupWorld(int nPickupId, int nWorld);
GetPickupWorld(int nPickupId);
PickupGetAlpha(int nPickupId);
PickupSetAlpha(int nPickupId, int nAlpha);
PickupIsAutomatic(int nPickupId);
PickupSetAutomatic(int nPickupId, unsigned int bToggle);
SetPickupAutoTimer(int nPickupId, int nTimer);
GetPickupAutoTimer(int nPickupId);
PickupRefresh(int nPickupId);
PickupGetPos(int nPickupId, float* pfPosX, float* pfPosY, float* pfPosZ);
PickupSetPos(int nPickupId, float fPosX, float fPosY, float fPosZ);
PickupGetModel(int nPickupId);
PickupGetQuantity(int nPickupId);

//OBJECTS
CreateObject(int nModelId, int nWorld, float fPosX, float fPosY, float fPosZ, int nAlpha);
DeleteObject(int nObjectId);
IsObjectStreamedForPlayer(int nObjectId, int nPlayerId);
GetObjectModel(int nObjectId);
SetObjectWorld(int nObjectId, int nWorld);
GetObjectWorld(int nObjectId);
SetObjectAlpha(int nObjectId, int nAlpha, int nTime);
GetObjectAlpha(int nObjectId);
MoveObjectTo(int nObjectId, float fX, float fY, float fZ, int nTime);
MoveObjectBy(int nObjectId, float fX, float fY, float fZ, int nTime);
SetObjectPos(int nObjectId, float fX, float fY, float fZ);
GetObjectPos(int nObjectId, float* pfPosX, float* pfPosY, float* pfPosZ);
RotObjectTo(int nObjectId, float fX, float fY, float fZ, float fW, int nTime);
RotObjectToEuler(int nObjectId, float fX, float fY, float fZ, int nTime);
RotObjectBy(int nObjectId, float fX, float fY, float fZ, float fW, int nTime);
RotObjectByEuler(int nObjectId, float fX, float fY, float fZ, int nTime);
GetObjectRot(int nObjectId, float* pfX, float* pfY, float *pfZ, float *pfW);
GetObjectRotEuler(int nObjectId, float* pfX, float* pfY, float *pfZ);
SetObjectShotReport(int nObjectId, unsigned int bToggle);
IsObjectShotReport(int nObjectId);
SetObjectBumpReport(int nObjectId, unsigned int bToggle);
IsObjectBumpReport(int nObjectId);

//FIXME: move on major update, currently keeping compatibility
RedirectPlayerToServer(int nPlayerId, const char* szIP, unsigned int usPort, const char* szNickname, const char* szServerPass, const char* szUserPass);
GetPlayerOnFireStatus(int nPlayerId);
GetPlayerCrouchStatus(int nPlayerId);
GetPlayerAction(int nPlayerId);
GetPlayerGameKeys(int nPlayerId);
GetPlayerAimPos(int nPlayerId, float* pfX, float* pfY, float* pfZ);
GetPlayerAimDir(int nPlayerId, float* pfX, float* pfY, float* pfZ);