AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   code crash the server (https://forums.alliedmods.net/showthread.php?t=249807)

JusTGo 10-12-2014 12:53

code crash the server
 
hi i m trying to create a hostage wiht this code but it crashed the server wiht no errors:
PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>

new HostageEntity[] = "hostage_entity"

public plugin_precache() 
{
  
precache_model("models/hostage.mdl"),
  
precache_model("models/scientist.mdl")
}

public 
plugin_init() 
{
  
register_clcmd("say /create","create_hostage")
}

public 
create_hostage(id)
{
  new 
origin[3], Float:hostage_origin[3]
  
get_user_origin(idorigin3)
  
IVecFVec(originhostage_origin)

  new 
hostage_ent create_entity(HostageEntity)
  if(
hostage_ent 0
  {
    
DispatchKeyValue(hostage_ent"model""models/hostage.mdl")
    
DispatchSpawn(hostage_ent)
    
entity_set_edict(hostage_entEV_ENT_owner33)
    
hostage_origin[2] += 2
    entity_set_origin
(hostage_enthostage_origin)

    
client_print(idprint_chat"[AMXX] You have created hostage.")
    return 
PLUGIN_HANDLED
  
}   
  return 
PLUGIN_HANDLED 



ironskillz1 10-12-2014 13:20

Re: code crash the server
 
You can easily see where the plugin crash if you debug it with
Code:

log_amx

wickedd 10-12-2014 13:29

Re: code crash the server
 
It should work on CS maps, but not DE maps.

Edit: I was right. Read this, it should help you.


All times are GMT -4. The time now is 17:33.

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