AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What is the difference between those two functions? (https://forums.alliedmods.net/showthread.php?t=338043)

GlobalPlague 06-01-2022 20:31

What is the difference between those two functions?
 
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?

Bugsy 06-01-2022 20:45

Re: What is the difference between those two functions?
 
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)

HamletEagle 06-02-2022 02:40

Re: What is the difference between those two functions?
 
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.


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

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