q1: pfn_touch called, then one of touching entities isnt found when u do something to it throwing a "Cannot find entity" error
i'm making a checkpoint mod for uwc3 (cs), where bomb/hostages are removed from the map, and instead 3-5 checkpoints are spawned into the map, and if one team controls all the checkpoints, the other team have X seconds to recapture a point or they all get slayed.
I got it working fine (no errors) on a test server on my machine with 5 players, and loads of bots... then when i moved it to one of our real servers, bits didnt work, and after adding debug, this line is causing the "cannot find entity" error was line 487 (attached sma below):
Code:
entity_get_string( iToucherId, EV_SZ_classname, szClassName, 31 )
from:
Code:
//----------------------------------------------------------------------------------------------
public pfn_touch( ptr, ptd ) {
return on_Touch( ptr, ptd )
}
//----------------------------------------------------------------------------------------------
public on_Touch( entity1, entity2 ) {
if(get_cvar_num("cp_enable") == 0) return PLUGIN_HANDLED
// Make sure it's a player that's being touched... mmmm
new iToucherId = entity1
new iPlayerId = entity2
if ( iPlayerId < 1 || iPlayerId > 32 || iToucherId < 1 || !is_user_alive( iPlayerId ) )
return PLUGIN_CONTINUE
new szClassName[32]
entity_get_string( iToucherId, EV_SZ_classname, szClassName, 31 )
// Change checkpoint's team
if ( equali( szClassName, "CHECKPOINT" ) ) {
// Change Checkpoint to iPlayerId's team etc etc etc
and yet stuff that can only happen if the szClassName is "CHECKPOINT" happens, even tho it cant find the entity. The checkpoint changes model to the right colour, but the xp isnt given (or even a msg to indicate that the xp function was called).
I've attached the sma, and the models (need to be in the models/uwc3_cp folder).. if anyone is bored and wants to try compiling it u wont need uwc3, just when it awards xp, it'll be 0
q2: the letter models attached have one sequence, idle which is the letter spinning 360 degrees on the spot. yet when i add the model in game, its static.
I was told the following would do the trick, but i tried 0 - 6 for the sequence number, and couldnt get it to work:
Code:
entity_set_int(iEnt, EV_INT_sequence, 0)
cheers in advance