cahadeyelo Posted December 28, 2016 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( [email protected]$, [email protected], [email protected], 0 ); if( [email protected]$ == "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 Share Posted December 29, 2016 - script SGH_POINTS -1,{ OnPCLoginEvent: if ($sghreward) end; addtimer 60000,"SGH_POINTS::OnSghGet"; end; OnSghGet: if ($sghreward) end; getmapxy( [email protected]$, [email protected], [email protected], 0 ); if( [email protected]$ == "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 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 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...
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( [email protected]$, [email protected], [email protected], 0 ); if( [email protected]$ == "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 by cahadeyeloLink to comment
Share on other sites