SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 18/08/2018, 03:39 PM   #701
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,520
Reputation: 305
Default Re: Today I learned - Share your newly found knowledge!

Quote:
Originally Posted by GRiMMREAPER View Post
Well, I really should've added an explanation as to why it happened.
I'd suggest using easyDialog or y_inline.
Logic_ is offline   Reply With Quote
Old 19/08/2018, 07:47 AM   #702
GaByM
Big Clucker
 
GaByM's Avatar
 
Join Date: Jan 2014
Location: Romania
Posts: 112
Reputation: 10
Default Re: Today I learned - Share your newly found knowledge!

Quote:
Originally Posted by Freaksken View Post
Method 1:
Method 2:
Method 3:
Code:
//define once
#define UNIQUE_ID 1


// Use this in any other file
enum FileName_ENUM {
	FileName_Login = UNIQUE_ID,
	FileName_Register
};
#undef UNIQUE_ID
#define UNIQUE_ID (_:FileName_ENUM)
GaByM is offline   Reply With Quote
Old 25/08/2018, 12:40 AM   #703
Mobtiesgangsa
Big Clucker
 
Join Date: Oct 2016
Posts: 116
Reputation: 16
Default Re: Today I learned - Share your newly found knowledge!

Today i learned SQLite checking with a timer

basicly what i did is

Code:
#include    [UNHANDLED-TAG=a_samp] #include    [UNHANDLED-TAG=zcmd] #include    [UNHANDLED-TAG=sscanf2][/UNHANDLED-TAG=sscanf2][/UNHANDLED-TAG=zcmd][/UNHANDLED-TAG=a_samp]

//Created a db specifier and a timer new DB:handle; new handletimer = 0;

main() {

}

///******************  *		Forwards  *//********************/ forward SQLiteReboot(DB:db); // forwarded a callback for the specified function

public OnGameModeInit() { 	if((handle = db_open(“server.db3”)) == DB:0) 	{            //made the temporary timer to call from a callback for each 3 seconds            // if its not connecting to restart or exit the gamemode 	    handletimer = SetTimerEx(“SQLiteReboot”, 3000, true, “d”, _:handle); 	} 	else 	{ 	    KillTimer(handletimer); 	} 	return 1; }

public OnGameModeExit() { 	if(handle) db_close(handle); 	return 1; }

public SQLiteReboot(DB:db) {         // restart or exit the gamemode and print the database warning 	GameModeExit(); 	printf(“[server]: cannot find handle %d”, _:handle); 	return _:handle; }
try by testing it by movind the scriptfiles in e seprete dir end CTRL-Z to return scriptfiles to the previous directory and if the server console detects the dir/scriptfiles it will run the database without no problem
Mobtiesgangsa is online now   Reply With Quote
Old 04/01/2019, 11:41 PM   #704
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 797
Reputation: 173
Default Re: Today I learned - Share your newly found knowledge!

Quote:
Originally Posted by SkyFlare View Post
Today I learned my partner does not like me talking in code to her.
I also learned I can get smart without her realizing it.

I told her if I don't stop talking in code to her that nothing will happen XD


Why would you do that? That's so retarded omfg.

cuber is offline   Reply With Quote
Old 04/01/2019, 11:43 PM   #705
J0sh...
Banned
 
Join Date: Aug 2014
Location: Hamburger
Posts: 1,305
Reputation: 461
Default Re: Today I learned - Share your newly found knowledge!

How do I delete someone else's post.
J0sh... is offline   Reply With Quote
Old 05/01/2019, 12:42 AM   #706
SkyFlare
Big Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 107
Reputation: 20
Default Re: Today I learned - Share your newly found knowledge!

Quote:
Originally Posted by cuber View Post
Why would you do that? That's so retarded omfg.
For fun? I guess you just dont understand it, maybe someone else will
__________________
pawn Code:
🍎--
             (•_•)                     (•_•)                  (•_•)       \(•_•)/  
             <) )–| I have a PEN    &#127822;–( (> I have an APPLE   ~) )~   Ughh  ) )   APPLE PEN
              / \                       / \                    / \          / \
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 06/01/2019, 06:40 AM   #707
SkyFlare
Big Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 107
Reputation: 20
Default Re: Today I learned - Share your newly found knowledge!

Quote:
Originally Posted by ****** View Post
No, read the first post.
damn, I did exactly what not to do I see, ill remove it lol woops
__________________
pawn Code:
&#127822;--
             (•_•)                     (•_•)                  (•_•)       \(•_•)/  
             <) )–| I have a PEN    &#127822;–( (> I have an APPLE   ~) )~   Ughh  ) )   APPLE PEN
              / \                       / \                    / \          / \
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 18/01/2019, 09:55 AM   #708
B3x7K
Big Clucker
 
B3x7K's Avatar
 
Join Date: Aug 2017
Location: 惑星黒トカゲ
Posts: 59
Reputation: 3
Default Re: Today I learned - Share your newly found knowledge!

Today i learned how to make include like Emmet_
but that code is messed up

You can look in here:
https://github.com/B3x7k/OnPlayerRestoreHack
__________________

HOW TO ENGLISH?!
AAAAAAAAAAAAAAAA

B3x7K is offline   Reply With Quote
Old 18/01/2019, 10:38 AM   #709
TheLeech
Big Clucker
 
Join Date: Aug 2015
Location: Under your bed
Posts: 149
Reputation: 5
Default Re: Today I learned - Share your newly found knowledge!

That converting from one version of MySQL to an other is really annoying.
TheLeech is offline   Reply With Quote
Old 13/02/2019, 02:44 PM   #710
RoboN1X
Huge Clucker
 
RoboN1X's Avatar
 
Join Date: Feb 2011
Location: Indonesia
Posts: 349
Reputation: 67
Default Re: Today I learned - Share your newly found knowledge!

Yesterday i learned (accidentally found) another trick of hiding a player holding object when their camera is aiming/on scope, BUT only hide for them while still visible for others.

It can be achieved without RemovePlayerAttachedObject but by using RemoveBuildingForPlayer on the model of the attached object at the offset calculated from the player pos to the attached offset at minimum radius as possible (so it wont accidentally remove real map objects nearby), then set the same attached object back when the player camera returns to normal...

Unfortunately it's not as reliable as is, due to the limits and the offset calculation needed from attached object and player bone while in motion. Maybe somebody could ever make it happen.
__________________
Need Help? Use Search, WIKI, and FAQ
RoboN1X is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Things you learned from GTA SA Toni Everything and Nothing 211 20/08/2011 07:07 AM
How you learned to script Bam23 Help Archive 9 11/04/2011 10:21 AM
What did u learned today ? rafay Everything and Nothing 170 30/03/2010 04:06 PM


All times are GMT. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.