AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help (https://forums.alliedmods.net/showthread.php?t=225024)

demortion 08-30-2013 23:40

help
 
im new to amx modx scripting ,i've ridden all the instructions after that i started scripting my first plugin
name (give_coins) it would give coins as (Amx_hp or amx_money works)
but while compiling i'm getting 3 to 4 errors
error 017:undefined symbol "give coins"
error 017:undefined symbol "give coins"
error 017:undefined symbol "give coins"
warning symbol assigned a value that is never used "coins"

#include <amxmodx>
#include <amxmisc>
#include <fun>

new PLUGIN[]="Change coins"
new AUTHOR[]="Uni.X10"
new VERSION[]="1.00"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_coins", "cmd_coins", ADMIN_SLAY, "<target> <coins>")
}

public cmd_coins(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new Arg1[24]
new Arg2[4]

//Get the command arguments from the console
read_argv(1, Arg1, 23)
read_argv(2, Arg2, 3)

//Convert the ammo from a string to a number
new coins = str_to_num(Arg2)

//Is the first character the @ symbol?
if (Arg1[0] == '@')
{
new Team = 0
if (equali(Arg1[1], "CT"))
{
Team = 2
} else if (equali(Arg1[1], "T")) {
Team = 1
}
new players[32], num
get_players(players, num)
new i
for (i=0; i<num; i++)
{
if (!Team)
{
give_coins(players[i], coins)
} else {
if (get_user_team(players[i]) == Team)
{
give_coins(players[i], coins)
}
}
}
} else {
new player = cmd_target(id, Arg1, 1)
if (!player)
{
console_print(id, "Sorry, player %s could not be found or targetted!", Arg1)
return PLUGIN_HANDLED
} else {
give_user_coins(player, coins)
}
}

return PLUGIN_HANDLED
}

SpaWn2KiLl 09-01-2013 09:52

Re: help
 
You have to make that function before use it...

Something like this:

PHP Code:

public give_user_coins(idcoins)
{
    new 
Money cs_get_user_money(id)
    new 
iMoney += Money
    cs_set_user_money
(idiMoney)




All times are GMT -4. The time now is 19:10.

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