Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Broadcast when new char create [Fixing]

Newbie Spellweaver
Joined
Jan 3, 2017
Messages
70
Reaction score
12
Hey ragezs, do you know how to create a broadcast when new character create ?
I make this one script to view new last character on roles, but i didn't know to broadcast this in game :sleep:

This is the code :
PHP:
<?php  
mysql_connect("localhost", "root", "xxxxxxxxxxxxxxx") or die(mysql_error());
mysql_select_db("pw") or die(mysql_error());  
$data = mysql_query("SELECT role_name,role_occupation FROM roles ORDER BY account_id DESC LIMIT 1")  or die(mysql_error());  

while($info = mysql_fetch_array( $data ))  {  
$role_name = $info['role_occupation'];
if ($role_name == "0") {     $ras = "Warrior";
} elseif ($role_name == "1") {    $ras = "Mage";
} elseif ($role_name == "2") {    $ras = "Psychic";
} elseif ($role_name == "3") {    $ras = "FoxLady";
} elseif ($role_name == "4") {    $ras = "Bestial";
} elseif ($role_name == "5") {    $ras = "Assassin";
} elseif ($role_name == "6") {    $ras = "Archer";
} elseif ($role_name == "7") {    $ras = "Priest";
} elseif ($role_name == "8") {    $ras = "Seeker";
} elseif ($role_name == "9") {    $ras = "Mystic";
} elseif ($role_name == "10") {    $ras = "Dudskblade";
} elseif ($role_name == "11") {    $ras = "Stormbringer";
} else {    echo "Tidak diketahui!";
} 

$bacot = "Hy nama saya : ".$info['role_name'] . " , saya adalah seorang ".$ras . " pemula, saya harap anda dapat membimbing saya :D";  
} 
echo $bacot;

?>

Actually i know but without cron jobs -_-, if you execute this script automatically please contact me:eek:tt:
 
Joined
Jul 17, 2007
Messages
665
Reaction score
104
Hey ragezs, do you know how to create a broadcast when new character create ?
I make this one script to view new last character on roles, but i didn't know to broadcast this in game :sleep:

This is the code :
PHP:
<?php  
mysql_connect("localhost", "root", "xxxxxxxxxxxxxxx") or die(mysql_error());
mysql_select_db("pw") or die(mysql_error());  
$data = mysql_query("SELECT role_name,role_occupation FROM roles ORDER BY account_id DESC LIMIT 1")  or die(mysql_error());  

while($info = mysql_fetch_array( $data ))  {  
$role_name = $info['role_occupation'];
if ($role_name == "0") {     $ras = "Warrior";
} elseif ($role_name == "1") {    $ras = "Mage";
} elseif ($role_name == "2") {    $ras = "Psychic";
} elseif ($role_name == "3") {    $ras = "FoxLady";
} elseif ($role_name == "4") {    $ras = "Bestial";
} elseif ($role_name == "5") {    $ras = "Assassin";
} elseif ($role_name == "6") {    $ras = "Archer";
} elseif ($role_name == "7") {    $ras = "Priest";
} elseif ($role_name == "8") {    $ras = "Seeker";
} elseif ($role_name == "9") {    $ras = "Mystic";
} elseif ($role_name == "10") {    $ras = "Dudskblade";
} elseif ($role_name == "11") {    $ras = "Stormbringer";
} else {    echo "Tidak diketahui!";
} 

$bacot = "Hy nama saya : ".$info['role_name'] . " , saya adalah seorang ".$ras . " pemula, saya harap anda dapat membimbing saya :D";  
} 
echo $bacot;

?>

Actually i know but without cron jobs -_-, if you execute this script automatically please contact me:eek:tt:

do you import data into mysql everytime after new character creation?
btw how to make broadcast, its in my phpadmin (signature), cpanel/server_proc.php
if ((isset($_GET['cr']))&&(isset($_GET['cc']))&&(isset($_GET['ct']))){
$chat_role=intval($_GET['cr']);
$chat_channel=intval($_GET['cc']);
$chat_text=trim($_GET['ct']);
if ($chat_text != ""){
$link = new mysqli($DB_Host, $DB_User, $DB_Password, $DB_Name);
$result = mysqli_query($link,"SELECT zoneid FROM point WHERE zoneid IS NOT NULL");
$count = Mysqli_num_rows($result);
$sockres = fsockopen($LanIP, $ServerPort, $errno, $errstr, 1);
if (!$sockres){
mysqli_query($link,"DELETE FROM online");
$SRunning=false;
}else{
@FClose($sockres);
$SRunning=true;
}
mysqli_free_result($result);
mysqli_close($link);
if ($SRunning===true){
include("packet_class.php");
$ChatBroadCast = new WritePacket();
$ChatBroadCast -> WriteUByte($chat_channel); //chat channel id
$ChatBroadCast -> WriteUByte(0); //Emotion
$ChatBroadCast -> WriteUInt32($chat_role); //Roleid but if offline then need to use 0
$ChatBroadCast -> WriteUString($chat_text); //Text
$ChatBroadCast -> WriteOctets(""); //Data
$ChatBroadCast -> Pack(0x78); //Opcode
$ChatBroadCast -> Send("localhost", 29300);
echo"<script>parent.AddLogMsg('Message sent to server!');</script>";
}else{
echo"<script>parent.AddLogMsg('Server is offline, cannot send message!');</script>";
}
}else{
echo"<script>parent.AddLogMsg('Do not send empty message!');</script>";
}
}
 
Upvote 0
Newbie Spellweaver
Joined
Jan 3, 2017
Messages
70
Reaction score
12
do you import data into mysql everytime after new character creation?
btw how to make broadcast, its in my phpadmin (signature), cpanel/server_proc.php
if ((isset($_GET['cr']))&&(isset($_GET['cc']))&&(isset($_GET['ct']))){
$chat_role=intval($_GET['cr']);
$chat_channel=intval($_GET['cc']);
$chat_text=trim($_GET['ct']);
if ($chat_text != ""){
$link = new mysqli($DB_Host, $DB_User, $DB_Password, $DB_Name);
$result = mysqli_query($link,"SELECT zoneid FROM point WHERE zoneid IS NOT NULL");
$count = @Mysqli_num_rows($result);
$sockres = @fsockopen($LanIP, $ServerPort, $errno, $errstr, 1);
if (!$sockres){
mysqli_query($link,"DELETE FROM online");
$SRunning=false;
}else{
@FClose($sockres);
$SRunning=true;
}
mysqli_free_result($result);
mysqli_close($link);
if ($SRunning===true){
include("packet_class.php");
$ChatBroadCast = new WritePacket();
$ChatBroadCast -> WriteUByte($chat_channel); //chat channel id
$ChatBroadCast -> WriteUByte(0); //Emotion
$ChatBroadCast -> WriteUInt32($chat_role); //Roleid but if offline then need to use 0
$ChatBroadCast -> WriteUString($chat_text); //Text
$ChatBroadCast -> WriteOctets(""); //Data
$ChatBroadCast -> Pack(0x78); //Opcode
$ChatBroadCast -> Send("localhost", 29300);
echo"<script>parent.AddLogMsg('Message sent to server!');</script>";
}else{
echo"<script>parent.AddLogMsg('Server is offline, cannot send message!');</script>";
}
}else{
echo"<script>parent.AddLogMsg('Do not send empty message!');</script>";
}
}
i make a broadcast form this :

i change $_POST['message']; to $bacot;
and it's work , but
But even spam -_-

and i will try you code ^_^ thanks , but i didn't how to set cronsjob every new user creating, Yesterday I tried but even per second: V hehe
 
Upvote 0
Newbie Spellweaver
Joined
Jan 26, 2017
Messages
23
Reaction score
5
why so bother with php script?
edit your task data with your tools.
add triger broadcast, limit with once for life time and level 1 only, then you done!
 
Upvote 0
Junior Spellweaver
Joined
Oct 16, 2012
Messages
136
Reaction score
46
why so bother with php script?
edit your task data with your tools.
add triger broadcast, limit with once for life time and level 1 only, then you done!

Here's the only true "right" answer. Set the task to only allow once and make it auto trigger in the initial spawn region.
 
Upvote 0
Newbie Spellweaver
Joined
Jan 3, 2017
Messages
70
Reaction score
12
why so bother with php script?
edit your task data with your tools.
add triger broadcast, limit with once for life time and level 1 only, then you done!
Thanks for your help :)

Btw, i want to tell you about a "Instant Boundary" and can you help to make instant boundary ? i can't found in ragezone forum :) , absolutely i found , and is not a automatic , it's set by pwAdmin in char edit
 
Upvote 0
Back
Top