Raised This Month: $ Target: $400
 0% 

Weird bug: script works for 1 person only [help plz]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 01-13-2007 , 17:23   Re: Weird bug: script works for 1 person only [help plz]
Reply With Quote #1

Code:
new num, players[32]     get_players(players,num,"ac")     for( new i = 0;  i < num; i++ )     {

I'm not sure why, but PAWN likes to screw things up in these for loops with lots of commands inside them for each player.
The way to fix this would be to code it like this:
Code:
public jail_timer(id) {     new num, players[32]     get_players(players,num,"ac")     for( new i = 0;  i < num; i++ )     {         jail2(players[i])     }     return PLUGIN_CONTINUE } public jail2(id) {     if (preso[id] == 0) return PLUGIN_HANDLED     else if (preso[id] == 1)     {         if ( timer_seconds[id] < 60) timer_seconds[id] += 1         else if (timer_seconds[id] >= 60)         {             timer_seconds[id] = 0             timer_minutes[id] += 1         }     }     return PLUGIN_CONTINUE }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
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 22:27.


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