mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement/match CPlayerPed::SetShopName(...)
This commit is contained in:
parent
e6e9fc67e2
commit
d649636a6d
@ -1045,3 +1045,33 @@ PCHAR CPlayerPed::GetShopName()
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
CHAR szShopName[32];
|
||||
|
||||
void CPlayerPed::SetShopName(char *szNewShopName)
|
||||
{
|
||||
if(!m_pPed) return;
|
||||
if(!GamePool_Ped_GetAt(m_dwGTAId)) return;
|
||||
|
||||
DWORD dwPedPtr = (DWORD)m_pPed;
|
||||
|
||||
if(szNewShopName && strlen(szNewShopName))
|
||||
{
|
||||
if(strlen(szNewShopName) <= 31)
|
||||
{
|
||||
memset(szShopName, 0, sizeof(szShopName));
|
||||
strncpy(szShopName, szNewShopName, sizeof(szShopName));
|
||||
|
||||
_asm mov eax, dwPedPtr
|
||||
_asm mov ebx, offset szShopName
|
||||
_asm mov [eax+1932], ebx
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_asm mov eax, dwPedPtr
|
||||
_asm mov byte ptr [eax+1932], 0
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
PCHAR GetLoadedShopName();
|
||||
void LoadShoppingDataSubsection(PCHAR szSectionName);
|
||||
PCHAR GetShopName();
|
||||
void SetShopName(char *szNewShopName);
|
||||
|
||||
|
||||
//char _gap0[813];
|
||||
|
Loading…
Reference in New Issue
Block a user