Guild icon
Teeworlds
discord.gg/teeworlds / general
Teeworlds Discord Server.
Between 2020-09-09 00:00:00Z and 2020-09-10 00:00:00Z
Fachini joined the server. 2020-09-09 02:51:01Z
Kza joined the server. 2020-09-09 09:26:48Z
Avatar
explodes kitchen
Avatar
@Deleted User pChr->m_Score += 5
10:31
where m_pPlayer is a pointer to a CPlayer instance (edited)
10:31
search for an existing code to see how it works. For example you can search for a flag take event on a CTF mode (edited)
Avatar
ok thx
Avatar
pChr should never be the name for a CPlayer xd
11:45
its used for CCharacter
11:45
So it would be pPlayer in your case
Avatar
you're right, thanks
12:42
fixed
12:47
I hope this list of solutions will grow big in time
cosmic joined the server. 2020-09-09 18:02:58Z
Avatar
so i modified a little the code, and nothing works
21:27
cpp int case WEAPON_SHOTGUN: { int ShotSpread = m_pPlayer->m_Upgrades.m_Spread * 4 + 2; if(m_pPlayer->m_Upgrades.m_PowerfulWeapons) ShotSpread = 15; CMsgPacker Msg(NETMSGTYPE_SV_EXTRAPROJECTILE); Msg.AddInt(ShotSpread*4+2); for(int i = -ShotSpread; i <= ShotSpread; ++i) { float Spreading[] = {-0.185f, -0.070f, 0, 0.070f, 0.185f}; if(m_pPlayer->m_Upgrades.m_Spread) Spreading[0] = i * 0.1f; float a = GetAngle(Direction); if(m_pPlayer->m_Upgrades.m_Spread) a += Spreading[0]; else a += Spreading[i+2]; float v = 1-(absolute(i)/(float)ShotSpread); float Speed = mix((float)GameServer()->Tuning()->m_ShotgunSpeeddiff, 1.0f, v); CProjectile *pProj = new CProjectile(GameWorld(), WEAPON_SHOTGUN, m_pPlayer->GetCID(), ProjStartPos, vec2(cosf(a), sinf(a))*Speed, (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_ShotgunLifetime), 1, 0, 0, -1, WEAPON_SHOTGUN); // pack the Projectile and send it to the client Directly CNetObj_Projectile p; pProj->FillInfo(&p); for(unsigned i = 0; i < sizeof(CNetObj_Projectile)/sizeof(int); i++) Msg.AddInt(((int *)&p)[i]); } Server()->SendMsg(&Msg, 0,m_pPlayer->GetCID()); GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE); } break; (edited)
21:28
it not shoot more bullets
21:28
anyone have ideas ?
Avatar
please use ``` for code pasting at least
21:35
int howitlooks = 1; bool example(int a) { bool prettycoolhuh = true; return prettycoolhuh; }
Avatar
how i use colors ?
Avatar
```cpp code
Avatar
not work
Avatar
int test; (edited)
21:46
works well for me. not sure what you are doing wrong
Avatar
wait
21:47
21:47
i do this
Avatar
did you put a space after cpp? that might have caused it
Avatar
i did and deleted it
21:49
tested everything
21:50
SO
21:50
how do i fix that
Avatar
int i = 0;
21:50
Try a simpler one first maybe?
Avatar
already tested
21:51
and idk what number to set for the shotgun
Exported 40 message(s)