Jakby nie rozumiem jednego pytasz już drugi raz o ten sam błąd.. Dodaj sprawdzanie id gracza..
Podmien ten public i sprawdz...
public Forward_PlayerTouch( ent, id ) {
if(!is_user_connected(id)){
return FMRES_IGNORED;
}
if( !pev_valid( ent ) ) {
return FMRES_IGNORED;
}
new classname[ MAX ];
pev( ent, pev_classname, classname, charsmax( classname ) );
if( !equal( classname, gMedKitClassname ) && !equal( classname, "pdm_money") ){
return FMRES_IGNORED;
}
if ( equali( classname, gMedKitClassname ) ) {
new health = get_user_health( id );
new cvarhealth = get_pcvar_num( gCvar[ cApteczka ][ 2 ] );
new maxhealth = get_pcvar_num( gCvar[ cApteczka ][ 3 ] );
if( health >= maxhealth ) {
client_print( id, print_center, "Soorki ale masz %d HP. Wiec nie mozesz tego podnies :(! Musisz miec mniej jak %d HP aby to podnies :).", health, maxhealth );
return FMRES_IGNORED;
}
set_hudmessage( 255, 0, 0, -1.0, 0.83, 2, 6.0, 3.0 );
show_hudmessage( id, "Odzyskales %d HP", cvarhealth );
fm_set_user_health( id, health + cvarhealth );
emit_sound( id, CHAN_ITEM, gPluginSounds[ psApteczka ], VOL_NORM, ATTN_NORM ,0 , PITCH_NORM );
message_begin( MSG_ONE_UNRELIABLE, gMsg[ mItemPickUp ], _, id );
write_string( "item_healthkit" );
message_end();
if( get_pcvar_num( gCvar[ cApteczka ][ 1 ] ) == 1 ) {
message_begin( MSG_ONE_UNRELIABLE, gMsg[ mScreenFade ] , _, id );
write_short( 1<<10 );
write_short( 1<<10 );
write_short( 0x0000 );
write_byte( 255 );
write_byte( 0 );
write_byte( 0 );
write_byte( 75 );
message_end();
}
engfunc( EngFunc_RemoveEntity, ent );
}
if ( equali( classname, "pdm_money" ) ) {
if( cs_get_user_money( id ) == get_pcvar_num( gCvar[ cKasa ][ 2 ] ) ) {
return FMRES_IGNORED;
}
else if( ( cs_get_user_money( id ) + moneybox[ ent ] ) > get_pcvar_num( gCvar[ cKasa ][ 2 ] ) ) {
cs_set_user_money( id, get_pcvar_num( gCvar[ cKasa ][ 2 ] ) );
}
else {
cs_set_user_money( id, cs_get_user_money( id ) + moneybox[ ent ] );
}
emit_sound( id, CHAN_ITEM, gPluginSounds[ psKasa ], VOL_NORM, ATTN_NORM ,0 , PITCH_NORM );
if( pev_valid( ent ) )
engfunc( EngFunc_RemoveEntity, ent );
if( get_pcvar_num( gCvar[ cKasa ][ 1 ] ) ) {
message_begin( MSG_ONE, gMsg[ mScreenFade ], { 0, 0, 0 }, id );
write_short( 1<<12 );
write_short( 1<<12 );
write_short( 1<<12 );
write_byte( 0 );
write_byte( 200 );
write_byte( 0 );
write_byte( 20 );
message_end( );
}
}
return FMRES_IGNORED;
}