Raised This Month: $ Target: $400
 0% 

a little help with a error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-11-2007 , 15:14   a little help with a error
Reply With Quote #1

hy all,i am new on this forum and just learning some things . i am tryng to make myselef a plugin that addes extra life,armour,speed,gravity ,but when i try to compile this code i get the next error:
/home/groups/amxmodx/tmp3/php14L84z.sma(21) : error 035: argument type mismatch (argument 2)
here is my code :
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "CipryXXX`s Fun plugin"
#define VERSION "1.0"
#define AUTHOR "CipryXXX"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /menu","Meniu")
}
public Meniu(id)
{
    new menu
    menu = register_menu ("CipryXXX`s Fun plugin","Meniu2")
    menu_additem(menu,"\wLife - 4000$(addes 150HP)","1",0)
    menu_additem(menu,"\wArmour - 2000$(addes 150 armour)","2",0)
    menu_additem(menu,"\wSpeed - 3000$(addes extra speed)","3",0)
    menu_additem(menu,"\wGravity - 2000$(addes extra gravity)","4",0)    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id,menu,0)
}
public Meniu2(id,menu,item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    else
    {
        if (!is_user_alive(id))
        {
            client_print(id, print_center, "U are dead and u can not access the menu.")
        }
        else
        {
            new buton[100],nume[100]
            new access, callback
            menu_item_getinfo(menu,item,access,buton,99,nume,99,callback)
            new tasta
            tasta = str_to_num(buton)
            switch (tasta)
            {
                case 1: life(id)
                case 2: armour(id)
                case 3: speed(id)
                case 4: gravity(id)
            }
        }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
public life(id)
{
    if ( cs_get_user_money(id)<= 4000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra life")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-4000)
        set_user_health(id,get_user_health(id)+150)
    }
}
public armour(id)
{
    if ( cs_get_user_money(id)<= 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra armour")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_armor(id,get_user_armor(id)+150)
    }
}
public speed(id)
{
    if ( cs_get_user_money(id)<= 3000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra speed")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-3000)
        set_user_maxspeed(id,0.0)
    }
}
public gravity(id)
{
    if ( cs_get_user_money(id)<= 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra gravity")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_gravity(id,0.5)
    }
}

Last edited by CipryXXX; 04-12-2007 at 05:47.
CipryXXX is offline
Send a message via Yahoo to CipryXXX
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-11-2007 , 17:09   Re: a little help with a error
Reply With Quote #2

Your mismatching menu code.

Code:
menu = register_menu ("CipryXXX`s Fun plugin","Meniu2")

when your suppose to use menu_create
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-12-2007 , 05:39   Re: a little help with a error
Reply With Quote #3

works now but i got a problem , when i chose speed and change my weapon my speed is normal again so i did this:
Code:
public speed(id)
{
    if ( cs_get_user_money(id)< 3000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra speed")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-3000)
        set_user_maxspeed(id, 0.0)
        new clip,ammo
        if (get_user_weapon ( id, clip, ammo ) != CSW_KNIFE)
        {
            set_user_maxspeed(id, 0.0)
        }
        else
        {
            set_user_maxspeed(id, 0.0)
        }
    }
}
but still doesent work...changes to normal speed if i change my weapon
CipryXXX is offline
Send a message via Yahoo to CipryXXX
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-12-2007 , 13:57   Re: a little help with a error
Reply With Quote #4

Quote:
Originally Posted by CipryXXX View Post
works now but i got a problem , when i chose speed and change my weapon my speed is normal again so i did this:

//code ...

but still doesent work...changes to normal speed if i change my weapon
Your going to have to hook CurWeapon and set your speed back again when they change to another weapon. Because speed are reseted when they change to another weapon.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-12-2007 , 14:34   Re: a little help with a error
Reply With Quote #5

Hi, maybe take a look at my plugin..there is a solution for your problem ;)
http://forums.alliedmods.net/showthread.php?t=53603

greetz regalis

Hi bmann,
here is the new version of amx_super and unlimited Ammo... ;)
Attached Files
File Type: sma Get Plugin or Get Source (amx_super_regalis.sma - 613 views - 110.3 KB)
File Type: sma Get Plugin or Get Source (unlimitedAmmo.sma - 661 views - 2.3 KB)
__________________

Last edited by regalis; 05-28-2007 at 17:01.
regalis is offline
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-12-2007 , 16:28   Re: a little help with a error
Reply With Quote #6

here is what i mayd...dunno why its not working ,i mayd a new variable : viteza and in my public speed(id) if the user buys spees then viteza =1 and in my public check(id) i am test if the user changes the weapon if viteza=1 but doesent work...some help pls.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "CipryXXX`s Fun plugin"
#define VERSION "1.0"
#define AUTHOR "CipryXXX"

new viteza

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /menu","Meniu")
    register_event("check","check","be")
}
public Meniu(id)
{
    new menu
    menu = menu_create ("\rCipryXXX`s Fun plugin","Meniu2")
    menu_additem(menu,"\wLife - 4000$ (addes 150HP)","1",0)
    menu_additem(menu,"\wArmour - 2000$ (addes 150 armour)","2",0)
    menu_additem(menu,"\wSpeed - 3000$ (addes extra speed)","3",0)
    menu_additem(menu,"\wGravity - 2000$ (addes extra gravity)","4",0)    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id,menu,0)
}
public Meniu2(id,menu,item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    else
    {
        if (!is_user_alive(id))
        {
            client_print(id, print_center, "U are dead and u can not access the menu.")
        }
        else
        {
            new buton[100],nume[100]
            new access, callback
            menu_item_getinfo(menu,item,access,buton,99,nume,99,callback)
            new tasta
            tasta = str_to_num(buton)
            switch (tasta)
            {
                case 1: life(id)
                case 2: armour(id)
                case 3: speed(id)
                case 4: gravity(id)
            }
        }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
public life(id)
{
    if ( cs_get_user_money(id)< 4000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra life")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-4000)
        set_user_health(id,get_user_health(id)+150)
    }
}
public armour(id)
{
    if ( cs_get_user_money(id)< 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra armour")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_armor(id,get_user_armor(id)+150)
    }
}
public speed(id)
{
    if ( cs_get_user_money(id)< 3000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra speed")
    }
    else
    {
        viteza = 1
        cs_set_user_money(id,cs_get_user_money(id)-3000)
        set_user_maxspeed(id, 0.0)
    }
}
public gravity(id)
{
    if ( cs_get_user_money(id)< 2000)
    {
        client_print(id, print_center, "U dont have enough money to buy extra gravity")
    }
    else
    {
        cs_set_user_money(id,cs_get_user_money(id)-2000)
        set_user_gravity(id,0.5)
    }
}
public check(id)
{
    if (viteza == 1)
    {
        set_user_maxspeed(id, 0.0)
        new clip,ammo
        if (get_user_weapon(id,clip,ammo)!=CSW_KNIFE)
        {
            set_user_maxspeed(id, 0.0)
        }
        else
        {
            set_user_maxspeed(id, 0.0)
        }
    }
}

Last edited by CipryXXX; 04-12-2007 at 18:57.
CipryXXX is offline
Send a message via Yahoo to CipryXXX
pRED*
Join Date: Dec 2006
Old 04-12-2007 , 23:18   Re: a little help with a error
Reply With Quote #7

register the curweapon event like this..

Code:
register_event("CurWeapon", "check", "be","1=1")

Make vietza an array like this..

Code:
new vietza[33]

and then change all the vietza references to..

Code:
vietza[id]

Why in the check function are you checking if the user has a knife and giving them the same speed either way? and why are all the max speeds 0.0?..
pRED* is offline
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-13-2007 , 04:19   Re: a little help with a error
Reply With Quote #8

works ty all

Last edited by CipryXXX; 04-13-2007 at 04:41.
CipryXXX is offline
Send a message via Yahoo to CipryXXX
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 06:34.


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