Raised This Month: $32 Target: $400
 8% 

What is the difference between those two functions?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 06-01-2022 , 20:31   What is the difference between those two functions?
Reply With Quote #1

Hi. Can someone explain to me what is the difference between those two functions:

PHP Code:
new Float:array[3
PHP Code:
new bool:array[3
Those functions are intended for saving information. But what is the difference between Float and Bool? How is a plugin that uses Bool different than a plugin that uses Float?
GlobalPlague is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-01-2022 , 20:45   Re: What is the difference between those two functions?
Reply With Quote #2

They are not functions, they are variables/arrays. You are correct in that they store information.

A Float holds a floating point decimal: 3.146534
A bool holds true or false

It depends on what you need to save, obviously:
For the bool, you could store whether or not a player is connected, is a bot, etc
For the Float, you could store any numerical value that is a decimal (non-integer)
__________________

Last edited by Bugsy; 06-01-2022 at 20:45.
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-02-2022 , 02:40   Re: What is the difference between those two functions?
Reply With Quote #3

I strongly suggest you start reading tutorials, for example this one: https://forums.alliedmods.net/showthread.php?t=94381

You'll learn a lot and be able to get your answers instantly, instead of waiting for someone to reply.
__________________
HamletEagle is offline
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

Forum Jump


All times are GMT -4. The time now is 09:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode