Man reiktų, kad kai žaidėjas gauną ginklą, tai tam ginklui būtų suteiktas specialus ID ar panašiai, pagal kurį galima būtų suteikti tam ginklui visokias savybes. Ne tam žaidėjui, o tam ginklui.
Bet man gavosi taip, kad jeigu žaidėjas tą ginklą išmeta, o po to vėl pasiima, tuomet to specialaus ID nebelieka, nes kaip suprantu pasikeičia pačio ginklo ID.
Padarius taip:
Code: Select all
// Kai žaidėjas gauna ginkląnew ent = give_item(id, WEAPONS[item])log_amx("Weapon ENT: %d", ent) entity_set_int(ent, EV_INT_iuser1, item) // specialus idlog_amx("Ginklo spec. ID: %d", entity_get_int(ent, EV_INT_iuser1)) // Kai žaidėjas paima ginklą nuo žemėspublic hWeaponTouch(ent, id){ if(!is_user_alive(id) || !pev_valid(ent)) return HAM_IGNORED new iEntSpecID = entity_get_int(ent, EV_INT_iuser1) // specialus ID log_amx("Ginklo ID: %d, Specialus ID: %d", ent, iEntSpecID) // ... return FMRES_IGNORED}
Code: Select all
L 06/01/2013 - 15:08:02: Weapon ENT:: 75L 06/01/2013 - 15:08:02: Ginklo spec. ID: 27L 06/01/2013 - 15:08:03: Ginklo ID: 136, Specialus ID: 0