Help converting PAWN function to PHP.
#1

I'm currently working on a UCP for my for gamemode however when I created a login / register I realized that my script uses passwords that are whirpooled and then hashed which means I will have to do the same thing on the PHP side of things. So what I need is help converting this PAWN function into PHP, here it is.

Код:
salt[saltSize] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
Reply
#2

It'd be the same in PHP wouldn't it?

Not sure if this helps:

http://www.w3schools.com/php/func_math_rand.asp
http://us2.php.net/manual/en/function.hash.php
http://stackoverflow.com/questions/2...ool-by-default
Reply
#3

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Oh thanks, but what would the colons and question marks mean in the pawno and how would I do the same in php for those. If someone could rewrite it for me in php that'll be great.

Edit: I understand that the questions marks and colons are if...else statements but I have no idea how.
Reply
#4

They are called ternary operators. Slice made a helpful thread on these kind of tips and tricks that explain these operators in full detail.

https://sampforum.blast.hk/showthread.php?tid=216730
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)