Commit 58c63acd authored by Nico Schallehn's avatar Nico Schallehn

Kommando Befehl eingeführt

parent 66361973
...@@ -28,18 +28,26 @@ function ChatNachricht($text, $admin, $userchange ){ ...@@ -28,18 +28,26 @@ function ChatNachricht($text, $admin, $userchange ){
if((substr(trim($text), 0, 3) == "/p ") OR (substr(trim($text), 0, 3) == "/w ")) if((substr(trim($text), 0, 3) == "/p ") OR (substr(trim($text), 0, 3) == "/w "))
{ {
$end = strpos($text, ":"); $end = strpos($text, ":");
$privateAntwort =true;
$name = substr($text, 3, $end-3); $name = substr($text, 3, $end-3);
$UserID = UsernametoID($name); $UserID = UsernametoID($name);
$text = substr($text, $end+1); $text = substr($text, $end+1);
if(($UserID == false)){ if(($UserID == false)){
$privateAntwort =true;
$JamesText = "Deine Nachricht an ".$name." konnte ich leider nicht zustellen, da der Benutzer nicht existiert! :-("; $JamesText = "Deine Nachricht an ".$name." konnte ich leider nicht zustellen, da der Benutzer nicht existiert! :-(";
} }
} }
if ((trim($text) == "/Komandos") OR (trim($text) == "/Befehle") OR (trim($text) == "/commands")){
$privateAntwort =true;
$JamesText = "Folgende Befehle unterstützt dieser Chat:
<li>
<ul>/w [Username]:[Nachricht] - sendet eine private Nachricht (/p ist alias)</ul>
<ul>/commands - gibt diese Hilfe aus</ul>
</li>";
}
if ($privateAntwort){ if ($privateAntwort){
sendMessage( $JamesText , 1, 0, 0, $admin, $time, 0, $_SESSION['chatuserid']); sendMessage( $JamesText , 1, 0, 0, $admin, time(), 0, $_SESSION['chatuserid']);
}else{ }else{
sendMessage( $text, $_SESSION['chatuserid'], $userchange, 0, $admin, time(), 0, $UserID ); sendMessage( $text, $_SESSION['chatuserid'], $userchange, 0, $admin, time(), 0, $UserID );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment