![]() |
|
#1
|
|||
|
![]() Code:
char phrase[255]; database.GetRandPvPSaying(phrase); worldserver.SendEmoteMessage(0,0,0,15, "%s (%u %s) <%s> %s %s (%u %s) <%s> in %s!", this->GetName(),this->GetLevel(),classes[this->GetClass()],guild_mgr.GetGuildName(this->GuildID()), phrase, killer->GetName(),killer->GetLevel(),classes[killer->GetClass()],guild_mgr.GetGuildName(killer->GuildID()), zone->GetLongName() ); | ||
|
#2
|
||||
|
![]() Quote:
"%s (%u %s) <%s> %s %s (%u %s) <%s> in %s!" Lack of guild causes unnecessary ") <> ". This is why I have %s%s%s, If there's no guild name, why add the extra support text around it. It looks cleaner. You have an extra space before "in". I did forget the zone name, I'll add that to mine.
__________________
| |||
|
#3
|
|||
|
![]() desperate for attention
| ||
|
#4
|
|||
|
![]() btw what is that Rogean perl or something? What's the world coming to with ternary operations in a string format. Wonder if that's valid in C/C++
| ||
|
#5
|
||||
|
![]() Quote:
Code:
#include <stdio.h> int main() { const int b = 1; printf("%s %s", b ? "cando" : "nutdo", !b ? "cando" : "nutdo"); return 0; } Code:
cando nutdo | |||
Last edited by GODPARTICLE; 05-17-2013 at 10:03 PM..
|
|
#6
|
|||
|
![]() its a myisam table. reads are virtually 0 overhead for how often a pvp slaying happens, especially compared to the trillions of database calls happening constantly. I did it so they could be added in realtime without recompiling and resetting the server, but it could be hardcoded array (mt_rand might have the same overhead realistically)
oh the original line with <> was a copypasta of null's code | ||
Last edited by GODPARTICLE; 05-17-2013 at 09:52 AM..
|
|
#7
|
|||||
|
![]() Quote:
Quote:
__________________
| ||||
|
#8
|
|||||
|
![]() Quote:
__________________
Quote:
Wipe it clean. | ||||
|
#9
|
||||
|
![]() Quote:
__________________
![]() <Force> | |||
|
#10
|
|||
|
![]() plz send updates to my icq = 7050258
| ||
|
![]() |
|
|