cahadeyelo Posted December 28, 2016 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 170 Reputation: 1 Joined: 11/13/14 Last Seen: April 4 Share Posted December 28, 2016 (edited) how can i fix this script that it'll only give the item #30004 to the first player that completed his/her 3 minutes of staying ingame after my server launching. - script SGH_POINTS -1,{ OnPCLoginEvent: addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnSghGet: getmapxy( .@new$, .@x, .@y, 0 ); if( .@new$ == "new_1-1" ) { set SGH_MINUTE_P, SGH_MINUTE_P + 1; dispbottom "Gained : 1 Point(s). Total : "+SGH_MINUTE_P+" Minute(s)."; } if ( SGH_MINUTE_P == 3 ){ getitem 30004,1; $sghreward = 1; end; } addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnInit: if ($sghreward = 1) end; } Edited December 28, 2016 by cahadeyelo Quote Link to comment Share on other sites More sharing options...
0 nitrous Posted December 29, 2016 Group: Developer Topic Count: 4 Topics Per Day: 0.00 Content Count: 141 Reputation: 46 Joined: 08/14/12 Last Seen: Saturday at 07:07 AM Share Posted December 29, 2016 - script SGH_POINTS -1,{ OnPCLoginEvent: if ($sghreward) end; addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnSghGet: if ($sghreward) end; getmapxy( .@new$, .@x, .@y, 0 ); if( .@new$ == "new_1-1" ) { set SGH_MINUTE_P, SGH_MINUTE_P + 1; dispbottom "Gained : 1 Point(s). Total : "+SGH_MINUTE_P+" Minute(s)."; } if ( SGH_MINUTE_P == 3 ){ getitem 30004,1; $sghreward = 1; end; } addtimer 60000,"SGH_POINTS::OnSghGet"; end; } dont need the OnInit label Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted December 29, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 1 hour ago Share Posted December 29, 2016 OnSghGet: if ( $sghreward ) end; // <--- ADD THIS Quote Link to comment Share on other sites More sharing options...
0 cahadeyelo Posted December 29, 2016 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 170 Reputation: 1 Joined: 11/13/14 Last Seen: April 4 Author Share Posted December 29, 2016 can't say thank you enough to both of you sir Emistry & Nitrous. Quote Link to comment Share on other sites More sharing options...
Question
cahadeyelo
how can i fix this script that it'll only give the item #30004 to the first player that completed his/her 3 minutes of staying ingame after my server launching.
- script SGH_POINTS -1,{ OnPCLoginEvent: addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnSghGet: getmapxy( .@new$, .@x, .@y, 0 ); if( .@new$ == "new_1-1" ) { set SGH_MINUTE_P, SGH_MINUTE_P + 1; dispbottom "Gained : 1 Point(s). Total : "+SGH_MINUTE_P+" Minute(s)."; } if ( SGH_MINUTE_P == 3 ){ getitem 30004,1; $sghreward = 1; end; } addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnInit: if ($sghreward = 1) end; }
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.