Im working now for a few days with SP and im happy to work with, but I still have some questions which i couldnt figure out yet
1. How can i fire a event?
Syntax: Select all
es.event("initialize", "player_say")
es.event("setint", "player_say", "userid", userid)
es.event("setstring", "player_say", "text", text)
es.event("fire", "player_say")
2. Im having realy weird problems with the PYMYSQL - cursor - fetchall.
Its fine for getting all data, but when it gets from the server an empty callback, it shows for my script
func:
Syntax: Select all
VIP = sql.get.getVIP(steamid) #Returns () from SQL server
if VIP:
VIP[0]["custom_chatrank"]
File '..\chatRanks.py', lin
e 167, in getRank
if VIP[0]['custom_chatrank']:
TypeError: 'map' object is not subscriptable
Syntax: Select all
print(VIP)
<map object at 0x1C7F2270>
3.
Can i use filters for saytext2 messages? I want to send "team-only" messages.
4. How can i use Centertell and KeyHintText for CS:S?
Someone told me its just PlayerEntity(index).keyhinttext
5.
Im having problems with the SayFilter
Syntax: Select all
@SayFilter
def say_filter(index, teamonly, CCommand):
text = CCommand[1]
userid = userid_from_index(index)
Took that from a forum post
[SP] Caught an Exception:
TypeError: No registered converter was able to produce a C++ rvalue of type int
from this Python object of type tuple
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\chatRanks.py', lin
e 52, in say_filter
text = CCommand[1]
TypeError: 'bool' object is not subscriptable
6. How can i use the default color for SayText2 messages? I didnt found that when i try to switch from \x03 to "Default" (Yellow in css)
7. Is there an event or anything where i can see players key presses like 'IN_LEFT' 'IN_FORWARD'
8. How can i check if a player is onGround (couldnt find anything on forum/wiki)
9. Is there a module where I can check if a point is in a 3d rectangle? (think es had that with vecmath.isbetweenrect or something)
10. How can i Create triggers properly in SP??
Syntax: Select all
origin = Vector(map(min, zip(coord1,coord2)))
maxCoord = Vector(map(max, zip(coord1,coord2)))
index = es.createentity("trigger_multiple")
es.precachemodel("models/error.mdl")
es.entitysetvalue(index, "model", "models/error.mdl")
es.entitysetvalue(index, "delay", 0)
es.entitysetvalue(index, "spawnflags", 1)
es.spawnentity(index)
m_vecOrigin = origin
m_vecMins = Vector((0,0,0))
m_vecMaxs = maxCoord - m_vecOrigin
es.setindexprop(index, "CBaseEntity.m_Collision.m_vecMins", str(m_vecMins))
es.setindexprop(index, "CBaseEntity.m_Collision.m_vecMaxs", str(m_vecMaxs))
es.setindexprop(index, "CBaseEntity.m_Collision.m_nSolidType", 2)
teleport(index, m_vecOrigin, None, None)
return index
11. Is there something like
@OnStartTouch or @OnEndTouch
12. How can i actually call all trigger_multiples from a map and see their properties?
Syntax: Select all
entlist = es.createentityindexlist("trigger_multiple")
indexdict = {} for x in entlist:
indexdict[es.entitygetvalue(x, "targetname")] = x
13. Can i actually block someone's manuall clan tag change?
I mean when hes changing his clantag via the options menu from the player since im giving my players a specific clan_tag for each.
Thats all for now, thank you guys for the great support!
If i should stop creating for each questions a new thread just tell me so i can create a mega thread for my questions haha