Raised This Month: $ Target: $400
 0% 

Solv Error...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raresnr1
Member
Join Date: Apr 2012
Old 04-05-2013 , 06:14   Solv Error...
Reply With Quote #1

Hi... can someone fix me these errors?I have edited a JB VIP Plugin.. and i have some errors.


PHP Code:

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <xs>
#include <colorchat>

#define ADMIN_JBVIP ADMIN_LEVEL_H

new const VERSION[] = { "1.0" };

new const 
PREFIX[] = { "[JB.GamesIasi.Ro]" };

new 
g_max_clients;
new 
VipUsed[33];
new 
HasSpeed[33];
new 
bool:teleportat[33];
new
jb_message_connectjb_scoreboard;

new 
Float:fast_speed 400.0;
new 
Float:normal_speed 250.0;
new 
survivor1[ ] = "zombie_plague/survivor1.wav"

public plugin_precache() {
precache_model("models/rpgrocket.mdl");
precache_sound("zombie_plague/survivor1.wav")
precache_soundsurvivor1 );
}
public 
plugin_init(){
register_plugin("JailBreak: VIP Menu"VERSION"eRdeneR");

RegisterHam(Ham_Spawn"player""FwdHamSpawn_Post"1);
RegisterHam(Ham_Spawn"player""PlayerSpawn"1);
jb_scoreboard register_cvar("jb_scoreboard""1");
jb_message_connect register_cvar("jb_message_connect""1");

register_event("HLTV""NewRound""a""1=0""2=0");
register_event("CurWeapon""HookCurWeapon""be""1=1");

register_clcmd("say vipmenu""cmdVmenu");
register_clcmd("say /vipmenu""cmdVmenu");
register_clcmd("say_team vipmenu""cmdVmenu");
register_clcmd("say_team /vipmenu""cmdVmenu");
register_clcmd("teleport""teleport"

g_max_clients get_maxplayers();
}


public 
Scoare_Board(TaskIDid)
{
new 
szFlags get_user_flags(id);
new 
id TaskID 6910;
if(
szFlags ADMIN_JBVIP)
{
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"));
write_byte(id);
write_byte(4);
message_end();
}
}

public 
vip_disconnected(id)
{
new 
szFlags get_user_flags(id);
new 
szName[32],szHost[64];
get_user_name(idszNamecharsmax(szName));
get_cvar_string("hostname"szHost ,charsmax(szHost));
if(
szFlags ADMIN_JBVIP)
{
client_printc(id"%s VIP !g%s !n a iesit de pe !g%s"PREFIXszNameszHost);
}
}



public 
NewRound() {
for(new 
id 1id <= g_max_clientsid++){
teleportat[id] = false
}
}

public 
PlayerSpawn(id)
{
new 
szFlags get_user_flags(id);
new 
szScore get_pcvar_num(jb_scoreboard);
new 
szWeapon get_user_weapon(id);
if(
szFlags ADMIN_JBVIP)
{
if(!
szScore)
return 
PLUGIN_HANDLED;
else 
{

if (
get_user_team(id) == 1)
if(
szWeapon == CSW_C4)
set_task0.6"Bomb"id 6910 ); 
set_user_rendering(id,kRenderFxGlowShell,255,51,255,kRenderFxNone,0

set_task0.5"Scoare_Board"id 6910 );
return 
PLUGIN_HANDLED;
}
}
}

public 
vip_connected(id)
{
new 
szFlags get_user_flags(id);
new 
szName[32],szHost[64];
get_user_name(idszNamecharsmax(szName));
get_cvar_string("hostname"szHost ,charsmax(szHost));
if(
szFlags ADMIN_JBVIP)
{
emit_sound(0CHAN_AUTO"zombie_plague/survivor1.wav"1.0ATTN_NORM0PITCH_NORM)
ColorChat(0GREEN,"%s^x03 %s^x01 a intrat pe^x03 %s^x01"PREFIXszNameszHost);


return 
PLUGIN_HANDLED;
}
return 
PLUGIN_HANDLED;
}


public 
FwdHamSpawn_Post(id){
HasSpeed[id] = false;
VipUsed[id] = false;



set_user_maxspeed(idnormal_speed);
set_user_renderingid_000_);
strip_user_weapons(id);
give_item(id"weapon_knife");
set_user_footsteps(id0);
set_user_health(id ,150);
}


public 
client_putinserver(id)
{
new 
szMessage get_pcvar_num(jb_message_connect);

if(!
szMessage)
return 
PLUGIN_HANDLED;
else 
set_task(1.5"vip_connected"id);

return 
PLUGIN_HANDLED;
}


public 
cmdVmenu(id){
if(
is_user_alive(id) && get_user_flags(id) & ADMIN_JBVIP && !( VipUsed[id] ) )
{
VipMenu(id);
}
else if(
VipUsed[id])
{
client_printc(id"%s Ai folosit deja !gVIP Menu!n aceasta runda.Poti folosi runda viitoare"PREFIX);
}
else
{
client_printc(id"%s Doar !gVIP!n poate folosi meniul VIP"PREFIX);
return 
PLUGIN_HANDLED;
}

return 
PLUGIN_HANDLED;
}

public 
teleport(id)
{
if(!
is_user_alive(id))
return 
PLUGIN_HANDLED;

if(
teleportat[id])
return 
PLUGIN_HANDLED;

static 
Float:start[3], Float:dest[3]         
pev(idpev_originstart)         
pev(idpev_view_ofsdest)         
xs_vec_add(startdeststart)         
pev(idpev_v_angledest)         

engfunc(EngFunc_MakeVectorsdest)         
global_get(glb_v_forwarddest)         
xs_vec_mul_scalar(dest9999.0dest)         
xs_vec_add(startdestdest)         
engfunc(EngFunc_TraceLinestartdestIGNORE_MONSTERSid0)         
get_tr2(0TR_vecEndPosstart)         
get_tr2(0TR_vecPlaneNormaldest)         

static const 
player_hull[] = {HULL_HUMANHULL_HEAD}         
engfunc(EngFunc_TraceHullstartstartDONT_IGNORE_MONSTERSplayer_hull[_:!!(pev(idpev_flags) & FL_DUCKING)], id0)         
if (!
get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen)) 
{                 
engfunc(EngFunc_SetOriginidstart)                 
return 
PLUGIN_HANDLED         
}        

static 
Float:size[3]         
pev(idpev_sizesize) ;        

xs_vec_mul_scalar(dest, (size[0] + size[1]) / 2.0dest)        
xs_vec_add(startdestdest)     
engfunc(EngFunc_SetOriginiddest)    
    
teleportat[id] = true;

return 
PLUGIN_HANDLED;
}

public 
Set_GodMode(id)
{
client_printc(id"%s Nu mai ai !gGOD MODE!n."PREFIX);
set_user_godmode(id0);
remove_task(id);   
}


public 
VipMenu(id){
new 
menu menu_create("\yGamesIasi \rMENIU \gVIP""VipMenu_handler");

menu_additem(menu"\w225 Viata si Armura""1"0);
menu_additem(menu"\wDeagle with 1 bull""2"0);
menu_additem(menu"\wGravitatie - (300)""3"0);
menu_additem(menu"\wViteza""4"0);
menu_additem(menu"\wTeleportare""5"0);
menu_additem(menu"\wInvivizibil""6"0);
menu_additem(menu"\wGoDModE \r10 \secunde""7"0);

menu_setprop(menuMPROP_EXITMEXIT_ALL);
menu_display(idmenu0);
}
public 
VipMenu_handler(idmenuitem){
if( 
item == MENU_EXIT )
{
menu_destroy(menu);
return 
PLUGIN_HANDLED;
}

new 
data[6], iName[64];
new 
accesscallback;
menu_item_getinfo(menuitemaccessdata,5iName63callback);

new 
key str_to_num(data);

switch(
key)
{
case 
1:{
set_user_health(id225);
set_user_armor(id225);
VipUsed[id] = true;

client_printc(id"%s Ai primit !g255HP!n si !g255 Armura!n"PREFIX);
}
case 
2:{
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 1);
VipUsed[id] = true;

client_printc(id"%s Ai primit !gUsp!n cu !g1 glonte!n"PREFIX);
}
case 
3:{
set_user_gravity(id0.300);
client_printc(id"%s Ai primit !gGravitatie!n"PREFIX);
}
case 
4:{
VipUsed[id] = true;
HasSpeed[id] = true;

set_user_maxspeed(idfast_speed);

client_printc(id"%s Ai primit !gViteza!n"PREFIX);
}
case 
5:{
client_cmd(id"bind x ^"teleport^"");
client_printc(id"%s Apasa !gX !npentru !gteleport!n"PREFIX);
VipUsed[id] = true;
}
case 
6:{
set_user_rendering(idkRenderFxNone000kRenderTransAdd5);
set_user_footsteps(id1);
client_printc(id"%s Esti aproape  !gInvizibil!n"PREFIX);
}
case 
7:{
set_user_godmode(id1);
set_task(10.0"Set_GodMode"id);
VipUsed[id] = true;
}
}

menu_destroy(menu);
return 
PLUGIN_HANDLED;
}
public 
HookCurWeapon(id){
if(
HasSpeed[id]){
set_user_maxspeed(idfast_speed);
}
}

stock client_printc(const id, const input[], any:...){
new 
count 1players[32];
static 
msg[191];
vformat(msg190input3);

replace_all(msg190"!n""^x01"); 
replace_all(msg190"!g""^x04"); 
replace_all(msg190"!t""^x03"); 

if (
idplayers[0] = id; else get_players(playerscount"ch");
{
for (new 
0counti++)
{
if (
is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}


this is the error
Code:
Warning:  Unable to open sound/zombie_plague/survivor1.wav for transfer
L 04/05/2013 - 03:10:15: [FUN] Invalid player 8
L 04/05/2013 - 03:10:15: [AMXX] Displaying debug trace (plugin "vip1.amxx")
L 04/05/2013 - 03:10:15: [AMXX] Run time error 10: native error (native "set_user_maxspeed")
L 04/05/2013 - 03:10:15: [AMXX]    [0] vip1.sma::FwdHamSpawn_Post (line 135)
L 04/05/2013 - 03:10:15: [FUN] Invalid player 8
L 04/05/2013 - 03:10:15: [AMXX] Displaying debug trace (plugin "vip1.amxx")
L 04/05/2013 - 03:10:15: [AMXX] Run time error 10: native error (native "set_user_rendering")
L 04/05/2013 - 03:10:15: [AMXX]    [0] vip1.sma::PlayerSpawn (line 103)

Last edited by raresnr1; 04-05-2013 at 06:14.
raresnr1 is offline
raresnr1
Member
Join Date: Apr 2012
Old 04-07-2013 , 06:36   Re: Solv Error...
Reply With Quote #2

UP
raresnr1 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-07-2013 , 06:43   Re: Solv Error...
Reply With Quote #3

try adding a check in top of both spawn functions...

if(is_user_alive(id))


i know they if they spawn they are alive.. but try it .... then show error logs ...
__________________
Blizzard_87 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-07-2013 , 09:34   Re: Solv Error...
Reply With Quote #4

Quote:
Originally Posted by Blizzard_87 View Post
i know they if they spawn they are alive.. but try it .... then show error logs ...
Player spawn is called at least one during connect. Hence why you should check if they are alive
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 04-07-2013 at 09:35.
YamiKaitou is offline
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 00:09.


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