AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [PLUGIN] Help! (https://forums.alliedmods.net/showthread.php?t=17330)

Mr. Satan 08-29-2005 19:01

[PLUGIN] Help!
 
Why wont this work?!


Eh sorry, wrong section of the forums :(

Code:
// GIVING CLIENT ATTACKS ESF v1.2b by Mr. Satan //========================================================= #include <amxmod> #include <amxmisc> public give_item_pvk(admin_index,victim_index,weapon_give[]) {    new arg1[32]    read_argv(1,arg1,32)    new name[32]    get_user_name(victim_index,name,32)   // Remove The slashes before the follow 2 lines of code to enable info messages    // set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)    // show_hudmessage(0,"%s Has Been Given An Attack",name)     // Items        if (equal(weapon_give,"all")){       give_item(victim_index,"item_chainmail")       give_item(victim_index,"item_food")       give_item(victim_index,"item_leather")       give_item(victim_index,"item_platemail")       give_item(victim_index,"item_treasurechest")    } else if (equal(weapon_give,"chainmail")){       give_item(victim_index,"item_chainmail")    } else if (equal(weapon_give,"food")){       give_item(victim_index,"item_food")    } else if (equal(weapon_give,"leather")) {       give_item(victim_index,"item_leather")    } else if (equal(weapon_give,"platemail")){       give_item(victim_index,"item_platemail")    } else if (equal(weapon_give,"tchest")){       give_item(victim_index,"item_treasurechest")    } else {       client_print(admin_index,print_console,"[AMXX] There is no such item")       return PLUGIN_CONTINUE    }        // client_print(admin_index,print_console,"[AMXX] Client ^"%s^" has been given an item",name)    return PLUGIN_CONTINUE } public admin_item_pvk(id) {    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {       client_print(id,print_console,"[AMXX] You have no access to that command")       return PLUGIN_HANDLED    }    new argc = read_argc()    if (argc < 3) {       client_print(id,print_console,"[AMXX] Usage: amx_item_pvk < part of nick > or < # index > < item to give >")       return PLUGIN_HANDLED    }    new arg1[32]    new arg2[32]    new arg3[32]    read_argv(1,arg1,32)    read_argv(2,arg2,32)    read_argv(3,arg3,32) //Index    if (equal(arg1,"#")) {       if (is_user_connected(str_to_num(arg2))) {          give_item_pvk(id,str_to_num(arg2),arg3)       } else {          client_print(id,print_console,"[AMXX] Client not found")       }    } else {       new player = find_player("lb",arg1)       if (player) {          give_item_pvk(id,player,arg2)       } else {          client_print(id,print_console,"[AMXX] Client with that part of nick not found")       }    }        return PLUGIN_HANDLED } public plugin_init() {    register_plugin("PVK Give Items","1.2b","Dewd In The Newd")    register_concmd("amx_item_pvk","admin_item_pvk",ADMIN_LEVEL_A,"<part of nick> or <# index> <item to give>")    return PLUGIN_CONTINUE }

Brad 08-29-2005 21:22

Instead of making people that might help you have to compile your plugin, why don't you tell us what "doesn't work". Are you receiving errors? If so, what are they?

Mr. Satan 08-30-2005 04:46

It compiles fine, no errors. However, it is like the command isn't registered at all.

nightscreem 08-30-2005 16:15

doesn't you have to do something like this
Code:
new arg1[32] read_argv( 1, arg1, 32 ) new player = cmd_target( id, arg1, 5 ) give_item(player ,"item_leather")
you can change new player in new victim or something i think something like that will work
just an example i think something like that will work


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

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