Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

С++ / How to terminate further function calls?

Hi everyone! How can I complete a sequence of function calls if I already got the desired result?

ID
d6ouivnilegovhg7c7d0
author
punkochel's avatar

punkochel

@punkochel


View profile
Copy link
  Report member
started
Feb 10, 2025
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Programming
С++ / How to terminate further function calls?
punkochel's avatar

punkochel

@punkochel


View profile
Copy link
  Report member
• 1y
Programming

С++ / How to terminate further function calls?

Hi everyone! How can I complete a sequence of function calls if I already got the desired result?
Let's say not call onPlayerSpawn in Test2 if I already got what I wanted in Test1? Only if?


class Test1 : public PlayerSpawnEventHandler
{

public:
    void onPlayerSpawn(IPlayer &player) override
    {
        player.sendClientMessage(Colour::Cyan(), "Hello from the test class...");
    }
};

class Test2 : public PlayerSpawnEventHandler
{

public:
    void onPlayerSpawn(IPlayer &player) override
    {
        player.sendClientMessage(Colour::Cyan(), "Hello from the test2 class...");
    }
};

void Gamemode::onLoad(ICore* c)
{
    core_ = c;
    c->getPlayers().getPlayerConnectDispatcher().addEventHandler(this);
    c->getPlayers().getPlayerSpawnDispatcher().addEventHandler(this);
    c->getPlayers().getPlayerTextDispatcher().addEventHandler(this);

    test1_ = new Test1;
    c->getPlayers().getPlayerSpawnDispatcher().addEventHandler(test1_);

    test2_ = new Test2;
    c->getPlayers().getPlayerSpawnDispatcher().addEventHandler(test2_);
}
0 likes0 replies

    Please sign up or log in to reply