Raised This Month: $ Target: $400
 0% 

mysql problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-14-2007 , 05:58   mysql problem
Reply With Quote #1

i am making myself a plugin Vampire vs Werewolf , but for now i just whant to insert ppls name into my mysql data base but when i compile i get some warnings:these warnings are at connection,inserting,selection and dbi_num_rows lines.
Code:
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(54 -- 55) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(56) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(56 -- 57) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(57) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(63) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(69) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(69 -- 70) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpEOtwzw.sma(73) : warning 204: symbol is assigned a value that is never used: "inserting"
here is my plugin code for now
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <dbi>

#define PLUGIN "Vampire vs Werewolf"
#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 = menu_create ("\rVampire vs Werewolf","Meniu2")
    menu_additem(menu,"\wVampire","1",0)
    menu_additem(menu,"\wWerewol","2",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
    {
        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:Vampire(id)
            case 2:
            {
                client_print(id, print_center, "Werewolf FTW")
            }
        }
        
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
public Vampire(id)
{
    new name[100],error[100],connection,selection,inserting
    connection = dbi_connect("localhost", "root", " ", "plugin",error,99)
    get_user_name(id,name,99)
    selection = dbi_query(connection,"SELECT * FROM vampir WHERE Name = '%s'",name)
    if (selection == RESULT_FAILED)
    {
        client_print(id, print_center, "Selection Failed")
    }
    else
    {
        if (dbi_num_rows(selection) >0)
        {
            client_print(id, print_center, "U are already a Vampire")
        }
        else
        {
            inserting = dbi_query(connection,"INSERT INTO vampir(Name,XP,Level) VALUES('%s',0,0)",name)
            client_print(id, print_center, "U have been transformed into a Vampire")
        }
    }
}
CipryXXX is offline
Send a message via Yahoo to CipryXXX
 



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