Raised This Month: $ Target: $400
 0% 

personal profiles on a server?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Candy Man
Junior Member
Join Date: Dec 2005
Old 12-30-2005 , 15:29   personal profiles on a server?
Reply With Quote #1

I'm not making a mod, just a fun menu(which I have). But I want it set it up so that the user gets stuff back at the begining of a new round if he buys the "badge" version rather than loose it at the begining of a new round. I did this using custom CVARs, but this changes it for everyone...

how do I get it so that if player "a" buys the badge version only he starts out with the item next new round... not any other player unless they have also bought the badge.. Like in warcraft how they have seperate XPs somehow...
Candy Man is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 12-30-2005 , 16:38  
Reply With Quote #2

It is usually best to use arrays in order to accomplish this. Then you would tell the plugin to give the person with the badge the item but nobody else.
Seeing that I have a poor attention span, i will explain it rather than code it.
You will need an array that will store the players id (userid, steamid, etc...) (one of those). Then, you will need a for loop to check all of the indices and an if statement in the for loop to see if they have the badge. If they do, continue giving item, if they do not, go to the next index.
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
Candy Man
Junior Member
Join Date: Dec 2005
Old 12-30-2005 , 16:43  
Reply With Quote #3

Uh, actually how would you do that? Would you put the player's id in an array? Then give the item to the id? How would you make the plugin know that it wasn't overwriting another id?
[Edit] Oh I think I got it:
Code:
// this would happen if player bouth the badge new array[20] new count = 0 array[count] = id ++count //so next user who uses it will be in slot #1
ok, now how would I get this array to my other function which is triggered by a new round? I need another function because this one is trggered by a menu and I want to give the items to the user without the user doing anything.
Candy Man is offline
Reply



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 16:08.


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