Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: thijn on September 13, 2008, 12:27:12 am

Title: timer.refresh
Post by: thijn on September 13, 2008, 12:27:12 am
Hey all,
I want to make a script that checks if someone is at a location, ex: in the bank.
i thought something like:
Code: [Select]
timer.refresh 0 2 vcmp.chkloc(%name)
alias:
Code: [Select]

alias vcmp.chkloc {
if ((vcmp.rob.loc($1) == The Warenhouse) && ($vcmp.area($vcmp.getid($1)) != The Warenhouse)) {
vcmp.msg $vcmp.getid($1) You didnt gave the money on time. You lose $ $+ 100.
vcmp.cash- $vcmp.getid($1) 100
}
elseif ((vcmp.rob.loc($1) == The Warenhouse) && ($vcmp.area($vcmp.getid($1)) == The Warenhouse)) {
vcmp.msg $vcmp.getid($1) You gave the money just on time! You get 50% that 2500!
vcmp.cash+ $vcmp.getid($1) 2500
}
}
But this isnt working...
MIRC:
Quote
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
Why ??? ???
Not connected????
And how can i fix this problem??
Pleas help me...
Title: Re: timer.refresh
Post by: VRocker on September 13, 2008, 02:29:00 am
Your missing a few $'s

Any command which has brackets after is (in your case vcmp.rob.loc) should have a $ infront of it.
For example: vcmp.rob.loc($1) would become $vcmp.rob.loc($1)

It'll be the same for your timer. So it'll be
Code: [Select]
timer.refresh 0 2 $vcmp.chkloc(%name)
Title: Re: timer.refresh
Post by: thijn on September 13, 2008, 09:40:21 am
Sorry but its not working, thanks for you reply anyways.
now mirc gives this error:
Quote
* /timer: timer .refresh not active
How can i fix this??
Title: Re: timer.refresh
Post by: thijn on September 13, 2008, 12:12:17 pm
Pleas someone??
Title: Re: timer.refresh
Post by: VRocker on September 13, 2008, 03:03:47 pm
tried calling it timerrefresh? cant remember if dots after the timer mess things up

Another reason ofcourse is that your forgetting to start the timer :)
Title: Re: timer.refresh
Post by: Chezor on September 13, 2008, 03:08:33 pm
Sorry but its not working, thanks for you reply anyways.
now mirc gives this error:
Quote
* /timer: timer .refresh not active
How can i fix this??

hmm isnt there a space between timer and dot (.)

Code: [Select]
* /timer: timer .refresh not activeSee its timer space . refresh in your code

i think it shud be
Code: [Select]
* /timer: timer.refresh not activetimer dot refresh
Title: Re: timer.refresh
Post by: thijn on September 13, 2008, 06:22:24 pm
tried calling it timerrefresh? cant remember if dots after the timer mess things up

Another reason ofcourse is that your forgetting to start the timer :)
eeh how can i start and how can i stop it?
Title: Re: timer.refresh
Post by: Windlord on September 14, 2008, 08:04:16 am
Quote
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server
-
* /vcmp.rob.chk(%name): not connected to server

It's quite interesting that it's saying that you cannot use vcmp.rob.chk as I cannot see it in your scripts.

Plus, to start a timer all you have to do is...
Code: (Type this...) [Select]
//timer.refresh 0 2 $whatever_alias_you_need_to_use

I noticed that you are using an infinite timer for specific players.
Your $vcmp.chkloc(%name) is player specific so it would have to start a timer when the player joins then end it when the player leaves.
Code: (Ending a timer) [Select]
/timer.refresh off

Title: Re: timer.refresh
Post by: thijn on September 14, 2008, 12:04:14 pm
Thanks for your reply i try that.