$$ACTION Players Add [o:Object] to [o:PlayerObject]'s inventory with name [s:ItemName], Spewable when player dies [b:Spewable=FALSE] aAddObjectToInventoryNamed Adds a specific object to a player's inventory with a custom name Parameters: Object: Object to add PlayerObject: Player to get object ItemName: The name for this object Spewable: Whether the object should be spewed from the invent
| 4311 | $$END |
| 4312 | */ |
| 4313 | void aAddObjectToInventoryNamed(int Object, int PlayerObject, const char *name, bool Spewable) { |
| 4314 | msafe_struct mstruct; |
| 4315 | |
| 4316 | mstruct.objhandle = PlayerObject; |
| 4317 | mstruct.ithandle = Object; |
| 4318 | |
| 4319 | strncpy(mstruct.message, name, sizeof(mstruct.message) - 1); |
| 4320 | mstruct.message[sizeof(mstruct.message) - 1] = '\0'; |
| 4321 | |
| 4322 | if (Spewable) |
| 4323 | mstruct.flags = 0; |
| 4324 | else |
| 4325 | mstruct.flags = INVAF_NOTSPEWABLE; |
| 4326 | |
| 4327 | MSafe_CallFunction(MSAFE_INVEN_ADD_OBJECT, &mstruct); |
| 4328 | } |
| 4329 | |
| 4330 | /* |
| 4331 | $$ACTION |