Files

8 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2026-09-20 17:12:20 +00:00
# Phone and NPWD integration
`server.lua` sends NPWD SMS through `exports.npwd:emitMessage` to `PlayerData.charinfo.phone`. Most missions use `sendSmsToPlayer` with `pcall`; UNKNOWN introduction currently duplicates the direct call. The client `addPhoneContact` event forwards to `exports.npwd:sendNPWDMessage('CONTACTS','npwd:autoAddContact', contact)`. `/testcontact` exercises `exports.npwd:addContact` with a temporary Michael fixture and random 555 number. Preserve this debug exception separately from permanent contacts.
Permanent sender numbers: UNKNOWN `555-0100`, Crowbar `555-7384`, Mack `555-6842`, Vinny `555-3176`. Gabe, Deke and Cosmic Dave have no established number in this resource. Store permanent numbers once in contact definitions; do not generate them at resource start or change existing values. Preserve every SMS body and timing when moving code. Vinny's fence message is delayed 60–90 seconds after Easy Rider completion; the unlock is persisted only after successful send and then exposed through login sync.
The installed NPWD resource has local custom behavior, including the SMS popup duration patch in its compiled UI asset. A how_progression refactor must keep its current NPWD APIs and not overwrite NPWD files. Before changing phone code, inspect the installed NPWD exports and client bridge, check phone number/thread compatibility, and test first introduction, mission SMS, delayed Vinny SMS, reconnect and contact display.