Skip to content

Commit

Permalink
Merge pull request #89 from xxshady/patch-6
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianTerhorst authored Sep 27, 2023
2 parents 7935940 + a64e7be commit f7d248f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 79 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ A guide for the usage of the [alt:V C++ Module SDK](https://github.com/altmp/cpp
4. [Creating your own resource class](creating-resource.md)
5. [Handling events](handling-events.md)
6. [MValues](mvalues.md)
7. [Refs](refs.md)
8. [Final steps](final-steps.md)
7. [Final steps](final-steps.md)

## Contribution

Expand Down
4 changes: 2 additions & 2 deletions articles/creating-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public:
// Also useful for handling timers
}

void OnCreateBaseObject(alt::Ref<alt::IBaseObject> object) override
void OnCreateBaseObject(alt::IBaseObject* object) override
{
// Here you can e.g. add the base object to some list for validating if a base object still exists
}

void OnRemoveBaseObject(alt::Ref<alt::IBaseObject> object) override
void OnRemoveBaseObject(alt::IBaseObject* object) override
{
// Here you can e.g. remove the base object from some aforementioned list
}
Expand Down
4 changes: 2 additions & 2 deletions articles/handling-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ alt::ICore::Instance().SubscribeEvent(alt::CEvent::Type::PLAYER_CONNECT, [](cons
auto event = static_cast<const alt::CPlayerConnectEvent*>(ev);

// Gets the player that connected to the server
alt::Ref<alt::IPlayer*> player = event->GetTarget();
alt::IPlayer* player = event->GetTarget();
// Gets the connect reason
alt::StringView reason = event->GetReason();

Expand Down Expand Up @@ -71,7 +71,7 @@ bool MyResource::OnEvent(const alt::CEvent* ev)
auto event = static_cast<const alt::CPlayerConnectEvent*>(ev);
// Gets the player that connected to the server
alt::Ref<alt::IPlayer*> player = event->GetTarget();
alt::IPlayer* player = event->GetTarget();
// Gets the connect reason
alt::StringView reason = event->GetReason();
Expand Down
5 changes: 0 additions & 5 deletions articles/mvalues.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,3 @@ if(type == alt::IMValue::Type::INT)
Another example can be found in the [article about event handling](handling-events.md#how-to-emit-events).

> All the methods to create MValues can be found [here](https://github.com/altmp/cpp-sdk/blob/dev/ICore.h#L61).
## Refs

Now you also know what an MValue is and how to use it.
The next article will explain [what a Ref is and how to use it](refs.md).
66 changes: 0 additions & 66 deletions articles/refs.md

This file was deleted.

2 changes: 0 additions & 2 deletions articles/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
href: handling-events.md
- name: MValues
href: mvalues.md
- name: Refs
href: refs.md
- name: Modules for reference
href: modules-for-reference.md
- name: Client
Expand Down

0 comments on commit f7d248f

Please sign in to comment.