AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   One array for one player (https://forums.alliedmods.net/showthread.php?t=13569)

LynX 05-21-2005 14:51

One array for one player
 
I would like to create an array for only one person. How can I do this. Like this
Code:
 new OnePersonArray[1]
, or?
And, after I set it on one person, it will be like their own id which I can use in any function ,right? Thnx ^^

v3x 05-21-2005 14:55

Code:
public myFunc(id) {     new OnePersonArray[32]     new player = OnePersonArray[id] }
:)

LynX 05-21-2005 15:32

Lol ^^
If I do it like this, would I be able to set all the data on player who has that array in other public functions ( like its offsets, health, speed, origin, etc ) ?

v3x 05-21-2005 16:40

Make it global.
Code:
new OnePersonArray[32] public myFunc(id) {     new player = OnePersonArray[id]     myFunc2(player) } public myFunc2(player) {     set_user_health(player,100) }

LynX 05-22-2005 09:32

Thnx v3x

v3x 05-22-2005 10:12

Make the array size 33*


All times are GMT -4. The time now is 16:42.

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