AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   adding time (https://forums.alliedmods.net/showthread.php?t=185139)

yamin 05-13-2012 07:05

adding time
 
can i know how can i add time to someone and remove time from someone (just the code)

<VeCo> 05-13-2012 07:08

Re: adding time
 
Make a global array variable like:

PHP Code:

new user_time[33

And then use it with the player index...

PHP Code:

user_time[id//... += to add and -= to substract value 


GordonFreeman (RU) 05-13-2012 07:13

Re: adding time
 
lol, he need full code :P

yamin 05-13-2012 09:01

Re: adding time
 
Quote:

Originally Posted by GordonFreeman (RU) (Post 1708030)
lol, he need full code :P

gordon i was asking to help you

yamin 05-13-2012 09:05

Re: adding time
 
Quote:

Originally Posted by <VeCo> (Post 1708028)
Make a global array variable like:

PHP Code:

new user_time[33

And then use it with the player index...

PHP Code:

user_time[id//... += to add and -= to substract value 


can you give the full code :D

<VeCo> 05-13-2012 09:08

Re: adding time
 
Don't make double posts.

I didn't understand you what exactly is that "time" and what exaclty are you trying to do...

Here's a strange example with commands that add +1/-1 to the user_time, but I don't know what do you want...

PHP Code:

#include <amxmodx>
 
new user_time[33]
public 
plugin_init()
{
register_clcmd("say /timeadd","time_add")
register_clcmd("say /timesub","time_substract")
}
 
public 
time_add(iduser_time[id]++ //add 1 time (???)
public time_substract(iduser_time[id]-- //substract 1 time (???) 


yamin 05-13-2012 09:18

Re: adding time
 
Quote:

Originally Posted by <VeCo> (Post 1708113)
Don't make double posts.

I didn't understand you what exactly is that "time" and what exaclty are you trying to do...

Here's a strange example with commands that add +1/-1 to the user_time, but I don't know what do you want...

PHP Code:

#include <amxmodx>
 
new user_time[33]
public 
plugin_init()
{
register_clcmd("say /timeadd","time_add")
register_clcmd("say /timesub","time_substract")
}
 
public 
time_add(iduser_time[id]++ //add 1 time (???)
public time_substract(iduser_time[id]-- //substract 1 time (???) 


thanks


All times are GMT -4. The time now is 00:20.

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