Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==============================================================================
- _ ____ _____ __ __
- (_) _ \ ___ |_ _|__ __ _| \/ |
- | | |_) / __| | |/ _ \/ _` | |\/| |
- | | __/\__ \ | | __/ (_| | | | |
- |_|_| |___/ |_|\___|\__,_|_| |_|
- [iPs] Inversor de Valores
- Criado por: [iPs]DraKiNs
- Versão 0.1
- ==============================================================================*/
- #include a_samp
- //====== [ Functions Convert ] ===========
- #define positiveNumber(%0) _:((%0 * -0xFFFFFFFF) - (%0 * 0x2)) //Convert negative to positive
- #define negativeNumber(%0) _:((%0 / -0xFFFFFFFF) - (%0 * 0x2)) //Convert positive to negative
- //===== [ Example of Code ] ============
- public OnFilterScriptInit()
- {
- printf("%d",negativeNumber(010)); // to 10 negative
- printf("%d",positiveNumber(-25)); // to 25 positive
- return true;
- }
- //============= [ C / C++ ] ====================================
- #define positiveNumber(x) ((x * -0xFFFFFFFF) - (x * 0x2)) //Convert negative to positive
- #define negativeNumber(x) ((x / -0xFFFFFFFF) - (x * 0x2)) //Convert positive to negative
- int main()
- {
- printf("-10 Passado para Positivo: %d \n", positiveNumber(-10));
- printf("10 Passado para Negativo: %d \n", negativeNumber(10));
- return system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement