c++ standard functions

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
here i used _(kbhit()) func and yes it works well in a win32 app

[shcode=cpp]
int main()
{
bool _IsRunning = true;

while (_IsRunning)
{
_SA->LoadSAMP();
_SA->IsAvailable();
// comenzi
_IsRunning = false;
}

bool isKeyboardPressed = true;

while (isKeyboardPressed)
{
if (_kbhit())
{
char keyParam;
int valueParam;
keyParam = _getch();
valueParam = keyParam;
if (valueParam == 32)
{
_SA -> AddClientMessage(0xFFFFFF, "Test");
}
}
}
[/shcode]

another question is how can i see all the lines between every "{" and "}" so i can know which one belong (i saw this func on 2k17 vs , hope this is in 2k15 )

ex:

[shcode=cpp]while(true)
{
| if !bou
| {
| | //statement
| | //
| }
}
[/shcode]
 
Last edited:

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
dat's sad really sad no body could help me or just say something :/
anyway for the guys dat had the same problem or if they was just curious u have just to use the integred isKeyPressed SF func

[shcode=cpp]
if (SF->getGame()->isKeyPressed('B'))
{
SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(0, 0xAA, 0), "B key have been pressed. ");
}
[/shcode]
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Cause you make no sense, it's hard to understand what you need/want if you can't make your sentences/questions coherent.
You can find the 'guidelines' in Power Tools for 2015 or in this extension(i googled it for you..)
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
search c++ sf  api blast hk or u can get them from ug b ;/


springfield said:

can you tell me why _sleep(int) / Sleep(int) is freezing my game(only game not my pc) for int sec? which sleep func should i use then? :/

this shity dont works

[shcode=cpp]
#define callOpcode                  SF->getCLEO()->callOpcode
callOpcode(0001: wait 1000 ms);
[/shcode]
 

AR3S

Active member
Joined
Apr 7, 2016
Messages
41
Reaction score
0
doroftel said:
can you tell me why _sleep(int) / Sleep(int) is freezing my game(only game not my pc) for int sec? which sleep func should i use then? :/

this shity dont works

[shcode=cpp]
#define callOpcode                  SF->getCLEO()->callOpcode
callOpcode(0001: wait 1000 ms);
[/shcode]

most probably because you are using 'Sleep' on endscene or present
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You're calling Sleep from inside a loader lock(DllMain etc.) or from the game execution thread, or as said above.
If you want to use sleep you need to spawn your own thread(beginthread/createthread).
 
Top