Raised This Month: $ Target: $400
 0% 

number not increasing correctly?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-18-2005 , 17:17   number not increasing correctly?
Reply With Quote #1

ok for my lockpick plug in i am making it so how many sucessfull lock picking you done makes you gain lock picking skills.. etc. problem is thou that its not doing it right. here is code.

Code:
  //////////////////////////////////////////////////////////////////////////////////////////  // Lockskill level one  //////////////////////////////////////////////////////////////////////////////////////////  public lockskillone(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new doorid, doorbody, isdoor;         new pick = random_num(0, 20)         new increase = 0;         new breakpick = random_num(0, 20)     get_user_aiming(id,doorid,doorbody,9999);     if(is_valid_ent(doorid)) { // if valid ent         isdoor = is_door(doorid);     }     else { // if invalid ent         client_print(id,print_chat,"* [DOOR] Door is invalid or non-existant^n");         return PLUGIN_HANDLED;     }     if(isdoor == 0) { // if not a door entity         if(is_button(doorid)) { // if really a button             buttonuse(id); // go to button use             return PLUGIN_HANDLED;         }         client_print(id,print_chat,"* [LockPick] Must be near Door to lockpick^n");         return PLUGIN_HANDLED;     }     if(doorid > MAXDOORS-1) { // if exceeds our array         client_print(id,print_chat,"* [DOOR] ERROR: Too many entities^n");         return PLUGIN_HANDLED;     }     if(pick < 15) { // if lockpick doesnt work         client_print(id,print_chat,"* [LockPick] LockPick not successfull^n");         return PLUGIN_HANDLED;     }         if(breakpick == 3) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         if(increase == 5) { // Breakpick         client_print(id,print_chat,"* [LockPick] Your lockpicking skill has increased to level 2^n");                 lockskill = 2;                 set_task(0.1, "employmentstatus", id);         return PLUGIN_HANDLED;     }         if(breakpick == 10) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         if(breakpick == 19) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         // gotta wait to picklock foo'         if(canpick <= 0) {             client_print(id,print_chat,"* [LOCKPICK] You do not have a lockpick, buy one from admin.^n");             return PLUGIN_HANDLED;         }     force_use(id,doorid); // use the darn door         client_print(id,print_chat,"* [LockPick] Door has been LockPicked Sucessfully^n");         increase += 1;         set_task(0.1, "picklock", id);     return PLUGIN_HANDLED;  }  //////////////////////////////////////////////////////////////////////////////////////////  // Lockskill level two  //////////////////////////////////////////////////////////////////////////////////////////  public lockskilltwo(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new doorid, doorbody, isdoor;         new pick = random_num(0, 20)         new breakpick = random_num(0, 20)         new increase = 0;     get_user_aiming(id,doorid,doorbody,9999);     if(is_valid_ent(doorid)) { // if valid ent         isdoor = is_door(doorid);     }     else { // if invalid ent         client_print(id,print_chat,"* [DOOR] Door is invalid or non-existant^n");         return PLUGIN_HANDLED;     }     if(isdoor == 0) { // if not a door entity         if(is_button(doorid)) { // if really a button             buttonuse(id); // go to button use             return PLUGIN_HANDLED;         }         client_print(id,print_chat,"* [LockPick] Must be near Door to lockpick^n");         return PLUGIN_HANDLED;     }     if(doorid > MAXDOORS-1) { // if exceeds our array         client_print(id,print_chat,"* [DOOR] ERROR: Too many entities^n");         return PLUGIN_HANDLED;     }     if(pick < 12) { // if lockpick doesnt work         client_print(id,print_chat,"* [LockPick] LockPick not successfull^n");         return PLUGIN_HANDLED;     }         if(breakpick == 3) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         if(increase == 30) { // Breakpick         client_print(id,print_chat,"* [LockPick] Your lockpicking skill has increased to level 3^n");                 lockskill = 3;                 set_task(0.1, "employmentstatus", id);         return PLUGIN_HANDLED;     }         if(breakpick == 19) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         // gotta wait to picklock foo'         if(canpick <= 0) {             client_print(id,print_chat,"* [LOCKPICK] You do not have a lockpick, buy one from admin.^n");             return PLUGIN_HANDLED;         }     force_use(id,doorid); // use the darn door         client_print(id,print_chat,"* [LockPick] Door has been LockPicked Sucessfully^n");         increase += 1;         set_task(0.1, "picklock", id);     return PLUGIN_HANDLED;  }  //////////////////////////////////////////////////////////////////////////////////////////  // Lockskill level three  //////////////////////////////////////////////////////////////////////////////////////////  public lockskillthree(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new doorid, doorbody, isdoor;         new pick = random_num(0, 20)         new breakpick = random_num(0, 20)         new increase = 0;     get_user_aiming(id,doorid,doorbody,9999);     if(is_valid_ent(doorid)) { // if valid ent         isdoor = is_door(doorid);     }     else { // if invalid ent         client_print(id,print_chat,"* [DOOR] Door is invalid or non-existant^n");         return PLUGIN_HANDLED;     }     if(isdoor == 0) { // if not a door entity         if(is_button(doorid)) { // if really a button             buttonuse(id); // go to button use             return PLUGIN_HANDLED;         }         client_print(id,print_chat,"* [LockPick] Must be near Door to lockpick^n");         return PLUGIN_HANDLED;     }     if(doorid > MAXDOORS-1) { // if exceeds our array         client_print(id,print_chat,"* [DOOR] ERROR: Too many entities^n");         return PLUGIN_HANDLED;     }     if(pick < 10) { // if lockpick doesnt work         client_print(id,print_chat,"* [LockPick] LockPick not successfull^n");         return PLUGIN_HANDLED;     }         if(breakpick == 3) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         if(increase == 40) { // Breakpick         client_print(id,print_chat,"* [LockPick] Your lockpicking skill has increased to level 4 ^n");                 lockskill = 4;                 set_task(0.1, "employmentstatus", id);         return PLUGIN_HANDLED;     }         // gotta wait to picklock foo'         if(canpick <= 0) {             client_print(id,print_chat,"* [LOCKPICK] You do not have a lockpick, buy one from admin.^n");             return PLUGIN_HANDLED;         }     force_use(id,doorid); // use the darn door         client_print(id,print_chat,"* [LockPick] Door has been LockPicked Sucessfully^n");         increase += 1;         set_task(0.1, "picklock", id);     return PLUGIN_HANDLED;  }  //////////////////////////////////////////////////////////////////////////////////////////  // Lockskill level four  //////////////////////////////////////////////////////////////////////////////////////////  public lockskillfour(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new doorid, doorbody, isdoor;         new pick = random_num(0, 20)         new breakpick = random_num(0, 20)         new increase = 0;     get_user_aiming(id,doorid,doorbody,9999);     if(is_valid_ent(doorid)) { // if valid ent         isdoor = is_door(doorid);     }     else { // if invalid ent         client_print(id,print_chat,"* [DOOR] Door is invalid or non-existant^n");         return PLUGIN_HANDLED;     }     if(isdoor == 0) { // if not a door entity         if(is_button(doorid)) { // if really a button             buttonuse(id); // go to button use             return PLUGIN_HANDLED;         }         client_print(id,print_chat,"* [LockPick] Must be near Door to lockpick^n");         return PLUGIN_HANDLED;     }     if(doorid > MAXDOORS-1) { // if exceeds our array         client_print(id,print_chat,"* [DOOR] ERROR: Too many entities^n");         return PLUGIN_HANDLED;     }     if(pick < 8) { // if lockpick doesnt work         client_print(id,print_chat,"* [LockPick] LockPick not successfull^n");         return PLUGIN_HANDLED;     }         if(breakpick == 1) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         if(increase == 50) { // Breakpick         client_print(id,print_chat,"* [LockPick] Your lockpicking skill has increased to level 5 ^n");                 lockskill = 5;                 set_task(0.1, "employmentstatus", id);         return PLUGIN_HANDLED;     }         // gotta wait to picklock foo'         if(canpick <= 0) {             client_print(id,print_chat,"* [LOCKPICK] You do not have a lockpick, buy one from admin.^n");             return PLUGIN_HANDLED;         }     force_use(id,doorid); // use the darn door         client_print(id,print_chat,"* [LockPick] Door has been LockPicked Sucessfully^n");         increase += 1;         set_task(0.1, "picklock", id);     return PLUGIN_HANDLED;  }  //////////////////////////////////////////////////////////////////////////////////////////  // Lockskill level five  //////////////////////////////////////////////////////////////////////////////////////////  public lockskillfive(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new doorid, doorbody, isdoor;         new breakpick = random_num(0, 20)     get_user_aiming(id,doorid,doorbody,9999);     if(is_valid_ent(doorid)) { // if valid ent         isdoor = is_door(doorid);     }     else { // if invalid ent         client_print(id,print_chat,"* [DOOR] Door is invalid or non-existant^n");         return PLUGIN_HANDLED;     }     if(isdoor == 0) { // if not a door entity         if(is_button(doorid)) { // if really a button             buttonuse(id); // go to button use             return PLUGIN_HANDLED;         }         client_print(id,print_chat,"* [LockPick] Must be near Door to lockpick^n");         return PLUGIN_HANDLED;     }     if(doorid > MAXDOORS-1) { // if exceeds our array         client_print(id,print_chat,"* [DOOR] ERROR: Too many entities^n");         return PLUGIN_HANDLED;     }         if(breakpick == 15) { // Breakpick         client_print(id,print_chat,"* [LockPick] You broke your lockpick^n");                 canpick = 0;         return PLUGIN_HANDLED;     }         // gotta wait to picklock foo'         if(canpick <= 0) {             client_print(id,print_chat,"* [LOCKPICK] You do not have a lockpick, buy one from admin.^n");             return PLUGIN_HANDLED;         }     force_use(id,doorid); // use the darn door         client_print(id,print_chat,"* [LockPick] Door has been LockPicked Sucessfully^n");         set_task(0.1, "picklock", id);     return PLUGIN_HANDLED;  }

the problem is its that it doesnt seem to increase or something i tried setting it to if increase is 2 then it levels up but no matter how many times i am sucessfull ti never levels up
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
 



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 09:51.


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