AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time Error 10 (https://forums.alliedmods.net/showthread.php?t=17141)

Zenith77 08-26-2005 13:12

Run time Error 10
 
I keep getting run time error 10 on line 67 (marked) and i have no clue why :/

USING: AMXX 1.55

Code:
#include <amxmodx> #include <cstrike> public plugin_init() {     register_plugin( "PickPocket", "1.0", "Zenith77" )     register_clcmd( "amx_pickpocket", "pickpocket", ADMIN_ALL, "Pickpockets the person near you!" )     register_cvar( "pp_ppradius", "10" )     register_cvar( "pp_pickamount", "1000" ) } public pickpocket(id) {     new pocketer_origin[3]     new victim_origin[3]     new players_num     new players[32]     new pp_radius = get_cvar_num("pp_ppradius")             get_user_origin(id, pocketer_origin)         get_players(players, players_num, "a") // we use this for the for loop!         for( new i = 0; i<players_num; i++) {         if( is_user_alive(id) && get_user_team(id) != get_user_team(i) ) { // prevents pick pocketing from you own team....             // RIGHT HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**********************             get_user_origin(i, victim_origin) // RIGHT HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**********************               new distance = get_distance( pocketer_origin, victim_origin )                         if( distance <= pp_radius ) {                 cs_get_user_money(id)                 cs_get_user_money(i)                 // the above is just so it can "refernce" it                                 //[][][][][][][][][][][][][][][][][][][]                 // the below checks if the victim has no money or if                 // the pick pocketer has 16000 dollars..if so action is cancled!                 if(cs_get_user_money(i) == 0) {                     client_print(id, print_chat, "[AMXX] He has no money for you to take! Go search for someone else!" )                     return PLUGIN_HANDLED                 }                 if(cs_get_user_money(id) == 16000){                     client_print(id, print_chat, "[AMXX] Ok now your just being greedy, pick pocketing is only for needy people! :P" )                     return PLUGIN_HANDLED                 }                 //[][][][][][][][][][][][][][][][][][][][]                                                 new amount = get_cvar_num("pp_pickamount")                 new result                 new p_amount // pick pocketer amount of money                 new v_amount // victim amount of money                                 p_amount = cs_get_user_money(id)                 v_amount = cs_get_user_money(i)                 if(get_cvar_num("pp_pickamount") > v_amount) {                     new result2                                         // If you will noitce below this one is "equation" is different from the                     // one in the code below...this prevents negative numbers and                     // makes sure that if the vitim has less money than the pp_pickamount cvar                     //it prevents the pickpocketer from getting all the money....                                         result2 = amount - v_amount                                         new amount_pp = p_amount + result2                                         cs_set_user_money(i, 0, 1)                     cs_set_user_money(id, amount_pp, 1)                                         client_print(i, print_chat, "[AMXX] OH NO! You've been pick pocketed!")                     client_print(id, print_chat, "[AMXX] Congrats on your successful Pick! You never cease to amaze me ;)" )                                         return PLUGIN_HANDLED                 }                                 if(get_cvar_num("pp_pickamount") < v_amount) {                     // once again...do not modify the below....                                         result = v_amount - amount                                         new amount_pp = p_amount + result                                         cs_set_user_money(i, result, 1)                     cs_set_user_money(id, amount_pp, 1)                                         client_print(i, print_chat, "[AMXX] OH NO! You've been pick pocketed!")                     client_print(id, print_chat, "[AMXX] Congrats on your successful Pick! You never cease to amaze me ;)" )                                         return PLUGIN_HANDLED                 }             }         }     }     return PLUGIN_HANDLED } //

Sp4rt4n 08-26-2005 14:20

i thought it was

Code:
get_user_origin(id, origin, 0)

(but im a newb... so... yeah)

Zenith77 08-26-2005 14:34

no that would not be it..or else it would have called on the other functions and when it compiled it would have gave an error

Number of agruments does not match defintion

so...anythign else?

Sp4rt4n 08-26-2005 14:45

lol zenith, i changed

Code:
get_user_origin(i, victim_origin)

to

Code:
get_user_origin(i, victim_origin, 0)

just for the heck of it, and it didnt give me a runtime error or any errors

Zenith77 08-26-2005 14:47

did it work :?:

Sp4rt4n 08-26-2005 14:54

i havent tried it yet, but its giving me no errors/warnings during compilation or in the server console... ill have the ingame test in about 3 minutes

Sp4rt4n 08-26-2005 15:06

rawr, i dont know... its not working

Greenberet 08-26-2005 15:56

change
Code:
  for( new i = 0; i<players_num; i++) {         if( is_user_alive(id) && get_user_team(id) != get_user_team(i) ) {

to
Code:
  for( new i = 0; i<players_num; i++) {         if( is_user_alive(id)         &&  is_valid_ent( i ) // requires engine module         &&  is_user_alive( i )         &&  get_user_team(id) != get_user_team(i) ) {

and add
Code:
#include <engine>
to the include list

Zenith77 08-26-2005 21:30

1) I am not a noob so you dont have to tell me what to include...i think i know what functions go where

2) THNX!!


All times are GMT -4. The time now is 14:27.

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