SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/10/2018, 07:32 PM   #4581
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,457
Reputation: 3206
Default Re: Little coding questions - For general minor queries 5

Actually, I checked pawn-lang.pdf and it explicity says that only `+=`, `*=`, and `<<=` are valid. Why others aren't, I don't know, but I guess the logic was the default start is 0 and negative array indexes aren't valid. Also, you could just start at the other end and increment instead of decrement.
Y_Less is online now   Reply With Quote
Old 09/12/2018, 02:32 PM   #4582
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Pakistan
Posts: 1,545
Reputation: 283
Default Re: Little coding questions - For general minor queries 5

Not sure if this is the right place or not, but what is the best method to convert time stamps to human-readable date. Are there any alternatives to TimeStamp2Date include?
__________________
Cheap game-host (SA-MP, SA-MP Hosted tab, G-MOD etc) @ www.prestigesteve.com
Developer @ CookieDM/ COD:IW; Former developer of NSP:RP, COD:BO3, COD:AW, I:RP, PC:RP, ZL TDM.
  • You can't forcefully correct someone and you shouldn't waste your time on it because you can bring a horse to water but can't force it to drink.
  • Please don't message me asking for help, because by doing that, you're only limiting your support to one person when the whole community can help you here. Refer to scripting help section instead.
Logic_ is offline   Reply With Quote
Old 09/12/2018, 02:43 PM   #4583
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,457
Reputation: 3206
Default Re: Little coding questions - For general minor queries 5

https://forum.sa-mp.com/showthread.php?t=654663
Y_Less is online now   Reply With Quote
Old 30/12/2018, 05:49 PM   #4584
Gforcez
High-roller
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 1,164
Reputation: 367
Default Re: Little coding questions - For general minor queries 5

I've been out of the loop for a while. What's currently the best way to hash a password? I always used Whirlpool on my older gamemodes, but I'm not sure if that's still the best choice.
__________________

Gforcez is offline   Reply With Quote
Old 30/12/2018, 06:03 PM   #4585
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 868
Reputation: 71
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Gforcez View Post
I've been out of the loop for a while. What's currently the best way to hash a password? I always used Whirlpool on my older gamemodes, but I'm not sure if that's still the best choice.
The best way to hash a password is to use a strong hashing algorithm like Whirlpool and use it the following method:
Hash=(Password+Salt)

Although it is just easier to use the bcrypt plugin as it also does hashing and iterations for you.
__________________
Jeroen52 is offline   Reply With Quote
Old 30/12/2018, 06:49 PM   #4586
Gforcez
High-roller
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 1,164
Reputation: 367
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Jeroen52 View Post
The best way to hash a password is to use a strong hashing algorithm like Whirlpool and use it the following method:
Hash=(Password+Salt)

Although it is just easier to use the bcrypt plugin as it also does hashing and iterations for you.
I'm working with hashing, I'm just not sure if Whirlpool is still decent or if there's some new algorithm that's more secure or better. I'll check out bcrypt thanks!
__________________

Gforcez is offline   Reply With Quote
Old 05/01/2019, 02:46 PM   #4587
Amads
Big Clucker
 
Amads's Avatar
 
Join Date: Feb 2012
Location: Poland
Posts: 198
Reputation: 40
Default Re: Little coding questions - For general minor queries 5

PHP Code:
new Float:pos[3];
pos = {-888.6017,1515.5992,26.2831}; // like this? no
pos[3] = {-888.6017,1515.5992,26.2831}; // like this? hmm... no
pos[] = {-888.6017,1515.5992,26.2831}; // maybe this? hell no 
How in oblivion do I assign values to an array in this way?
Amads is offline   Reply With Quote
Old 05/01/2019, 09:29 PM   #4588
[HLF]Southclaw
Godfather
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 5,008
Reputation: 1578
Default Re: Little coding questions - For general minor queries 5

I believe that's only valid during initialisation and as arguments to functions.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 05/01/2019, 10:44 PM   #4589
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 3,750
Reputation: 647
Default Re: Little coding questions - For general minor queries 5

Like Southclaw said but that doesn't stop you from using it
pawn Code:
new Float:pos[3];
static const Float: _pos[sizeof pos] = {-888.6017,1515.5992,26.2831}; // static is you use it locally
pos = _pos;
Nero_3D is offline   Reply With Quote
Old 06/01/2019, 09:35 PM   #4590
DomnulRafael
Little Clucker
 
Join Date: Feb 2018
Posts: 13
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

how can i check the ground under me using ColAndreas? I am trying to make a horse system using setplayervelocity and i don't want the player flying around when he's on a clif and moves over it.. i'm looking in the include but i don't find a solution to it
DomnulRafael 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
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 04:35 PM
Minor problem Desert Help Archive 4 17/03/2010 07:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 03:36 PM
SQL queries using GROUP BY Dabombber Help Archive 2 05/10/2009 08:47 PM


All times are GMT. The time now is 08:21 PM.


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