AlliedModders

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

_ABnormal 11-04-2011 12:30

What error ?
 
Hi all . When i want to compile one plugin i got this error:
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/groups/amxmodx/compiler3/include/xs.inc(119) : fatal error 110: assertion failed: 0


Compilation aborted.
1 Error.

Can someone help me please ??

Emp` 11-04-2011 12:38

Re: What error ?
 
Code:

#if defined _amxmodx_included
        #define XS_PLATFORM XS_AMXX
#endif

#if defined _amxmod_included && !defined _amxmodx_included
        #define XS_PLATFORM XS_AMX
#endif

#if !defined XS_PLATFORM
        // Could not detect platform.
        // Make sure you include amxmodx.inc or amxmod.inc before including xs.inc
        #assert 0
        #endinput
#endif

Make sure you include amxmodx before xs.

ie:
Code:

#include <amxmodx>
#include <xs>


_ABnormal 11-04-2011 12:43

Re: What error ?
 
add me on skype :AdamDupkanic and i will write u all plugin

kramesa 11-04-2011 13:28

Re: What error ?
 
Show your code

_ABnormal 11-04-2011 13:57

Re: What error ?
 
Code:

#include <fakemeta>

#include <fakemeta_util>

#include <hamsandwich>

#include <cstrike>

#include <amxmisc>

#include <fun>



#define PLUGIN_NAME "vipas"

#define PLUGIN_AUTHOR "Kukulis"

#define PLUGIN_VERSION "0.1"



static const COLOR[] = "^x04"

static const CONTACT[] = ""



new maxplayers

new gmsgSayText



public plugin_init()

{

register_plugin(PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION);



register_event("ResetHUD","event_reset_hud","be");

register_event("ResetHUD", "resetModel", "b")

register_clcmd("say /vip","admin_motd",0,"- Shows the MOTD.")
register_event("DeathMsg", "Event_DeathMsg", "a")



register_clcmd("say", "handle_say")

register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)

gmsgSayText = get_user_msgid("SayText")



maxplayers = get_maxplayers()



return PLUGIN_CONTINUE



}



public plugin_precache() {

precache_model("models/player/smith/smith.mdl")

precache_model("models/player/smith/smith.mdl")



return PLUGIN_CONTINUE

}



public resetModel(id, level, cid) {

if (get_user_flags(id) & ADMIN_CVAR) {

new CsTeams:userTeam = cs_get_user_team(id)

if (userTeam == CS_TEAM_T) {

cs_set_user_model(id, "smith")

}

else if(userTeam == CS_TEAM_CT) {

cs_set_user_model(id, "smith")

}

else {

cs_reset_user_model(id)

}

}



return PLUGIN_CONTINUE

}





public event_reset_hud(id)

{

if(!is_user_connected(id))

return PLUGIN_CONTINUE;



client_print(id, print_chat, "[VIP] Napis /vip a pozri sa,co vsetko zahrnaju VIP vyhody !!!")



if(!access(id,ADMIN_CVAR))

return PLUGIN_CONTINUE;



set_task(1.0,"give_stuff",id);



return PLUGIN_CONTINUE;

}



public admin_motd(id,level,cid) {



    if (!cmd_access(id,level,cid,1))

    return PLUGIN_CONTINUE

   

    show_motd(id,"vip.txt","VIP by Kukulis")

    return PLUGIN_CONTINUE 

}









public give_stuff(id)

{

if(!is_user_connected(id))

return;



  fm_give_item(id, "item_assaultsuit");

  fm_give_item(id, "weapon_flashbang");

  fm_give_item(id, "weapon_flashbang");

  fm_give_item(id, "weapon_hegrenade");

  fm_give_item(id, "weapon_smokegrenade");

  cs_set_user_money(id, cs_get_user_money(id) + 500);

  set_user_gravity (id, 0.70);

}



public handle_say(id)

{

    new said[192]

    read_args(said,192)

    if(( containi(said, "who") != -1 && containi(said, "admin") != -1) || contain(said, "/vips") != -1)

        set_task(0.1,"print_viplist", id)

    return PLUGIN_CONTINUE

}



public print_viplist(user)

{

    new adminnames[33][32]

    new message[256]

    new contactinfo[256], contact[112]

    new id, count, x, len

   

    for(id = 1 ; id <= maxplayers ; id++)

        if(is_user_connected(id))

            if(get_user_flags(id) & ADMIN_CVAR)

                get_user_name(id, adminnames[count++], 31)



    len = format(message, 255, "%s Online VIP: ",COLOR)

    if(count > 0) {

        for(x = 0 ; x < count ; x++) {

            len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")

            if(len > 96 ) {

                print_message(user, message)

                len = format(message, 255, "%s ",COLOR)

            }

        }

        print_message(user, message)

    }

    else {

        len += format(message[len], 255-len, "No online VIP.")

        print_message(user, message)

    }



    get_cvar_string("amx_contactinfo", contact, 63)

    if(contact[0])  {

        format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)

        print_message(user, contactinfo)

    }

}



print_message(id, msg[])

{

    message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)

    write_byte(id)

    write_string(msg)

    message_end()

}

public Event_DeathMsg()
{
    new iKiller = read_data(1)
   
    if(is_user_alive(iKiller))
    {
            set_user_health(iKiller, get_user_health(iKiller) + 10)
    }
}


KillLikoe 11-04-2011 14:09

Re: What error ?
 
you have to add the #include <amxmodx> first of all

_ABnormal 11-04-2011 14:19

Re: What error ?
 
thanks a lot !!

KillLikoe 11-04-2011 14:29

Re: What error ?
 
hey abnormal i add the part that you sayed to me, to give awp only to admins

_ABnormal 11-04-2011 14:31

Re: What error ?
 
yes ?? thats so cool .. if you can send it to me there pls :) thanks !!

KillLikoe 11-04-2011 14:32

Re: What error ?
 
PHP Code:

 #include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>
#include <fun>

#define PLUGIN_NAME "vipas"
#define PLUGIN_AUTHOR "Kukulis"
#define PLUGIN_VERSION "0.1"

static const COLOR[] = "^x04"
static const CONTACT[] = ""

new maxplayers
new gmsgSayText

public plugin_init()    
{
    
register_plugin(PLUGIN_NAMEPLUGIN_AUTHORPLUGIN_VERSION);
    
register_event("ResetHUD","event_reset_hud","be");
    
register_event("ResetHUD""resetModel""b")
    
register_clcmd("say /vip","admin_motd",0,"- Shows the MOTD.")
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_clcmd("say""handle_say")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
    
gmsgSayText get_user_msgid("SayText")
    
maxplayers get_maxplayers()
}
public 
plugin_precache() 
{
    
precache_model("models/player/smith/smith.mdl")
    
precache_model("models/player/smith/smith.mdl")

    return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid
{

    if (
get_user_flags(id) & ADMIN_CVAR
    {
        new 
CsTeams:userTeam cs_get_user_team(id)
    
        if (
userTeam == CS_TEAM_T
        {    
            
cs_set_user_model(id"smith")        
        }
        else if(
userTeam == CS_TEAM_CT
        {        
            
cs_set_user_model(id"smith")        
        }    
        else 
        {        
            
cs_reset_user_model(id)        
        }    
    }
    return 
PLUGIN_CONTINUE
}
public 
event_reset_hud(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE;    
    
    
client_print(idprint_chat"[VIP] Napis /vip a pozri sa,co vsetko zahrnaju VIP vyhody !!!")    
    if(!
access(id,ADMIN_CVAR))
        return 
PLUGIN_CONTINUE;
        
    
set_task(1.0,"give_stuff",id);    
    return 
PLUGIN_CONTINUE;
    
}

public 
admin_motd(id,level,cid)
{    
    if (!
cmd_access(id,level,cid,1))
        return 
PLUGIN_CONTINUE    
        
    show_motd
(id,"vip.txt","VIP by Kukulis")    
    
    return 
PLUGIN_CONTINUE   
    
}
public 
give_stuff(id)    
{
    if(!
is_user_connected(id))
        return;
    
    if  (
is_user_admin(id))
    {
        
fm_give_item(id"item_assaultsuit");
        
fm_give_item(id"weapon_flashbang");
        
fm_give_item(id"weapon_flashbang");
        
fm_give_item(id"weapon_hegrenade");
        
fm_give_item(id"weapon_smokegrenade");
        
cs_set_user_money(idcs_get_user_money(id) + 500); 
        
set_user_gravity (id0.70);
        
fm_give_item(id"weapon_awp");
    }
    else
    {
        
fm_give_item(id"item_assaultsuit");
        
fm_give_item(id"weapon_flashbang");
        
fm_give_item(id"weapon_flashbang");
        
fm_give_item(id"weapon_hegrenade");
        
fm_give_item(id"weapon_smokegrenade");
        
cs_set_user_money(idcs_get_user_money(id) + 500); 
        
set_user_gravity (id0.70);
    }    
}

public 
handle_say(id)    
{
    new 
said[192]

    
read_args(said,192)

    if(( 
containi(said"who") != -&& containi(said"admin") != -1) || contain(said"/vips") != -1)
    {
        
set_task(0.1,"print_viplist"id)
    }
    
    return 
PLUGIN_CONTINUE    
}

public 
print_viplist(user)     
{
    new 
adminnames[33][32]

    new 
message[256]

    new 
contactinfo[256], contact[112]

    new 
idcountxlen

    
for(id id <= maxplayers id++)
    {    
        if(
is_user_connected(id))
        {
            if(
get_user_flags(id) & ADMIN_CVAR)
            {        
                
get_user_name(idadminnames[count++], 31)
            }
        }
    }
    
    
len format(message255"%s Online VIP: ",COLOR)
    
    if(
count 0
    {
        
        for(
count x++) 
        {
            
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            
            if(
len 96 
            {
                
                
print_message(usermessage)
                
                
len format(message255"%s ",COLOR)
                
            }
            
        }
        
        
print_message(usermessage)
        
    }
    
    else 
    {
        
        
len += format(message[len], 255-len"No online VIP.")
        
        
print_message(usermessage)
        
    }
    
    
    
    
get_cvar_string("amx_contactinfo"contact63)
    
    if(
contact[0])  
    {
        
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
        
print_message(usercontactinfo)
        
    }
    
}



print_message(idmsg[])
{
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)

    
write_byte(id)

    
write_string(msg)

    
message_end()


public 
Event_DeathMsg()
{
    new 
iKiller read_data(1)

    if(
is_user_alive(iKiller))
    {
        
set_user_health(iKillerget_user_health(iKiller) + 10)
    }




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

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