I need a little help please with a 'script'
on $*:TEXT:/^\s*\Wplayers?/Si:#: {
set -e %Players $chan
sockclose hits
sockopen hits cortanairc.epizy.com 80
<?php
require("SampQuery.class.php");
$query = new SampQuery("167.114.42.236", 7777);
if ($query->connect()) {
$aInformation = $query->getInfo();
$aServerRules = $query->getRules();
?>
[ Server 1 (<?= htmlentities($aServerRules['mapname']) ?>, <?= $aServerRules['worldtime'] ?>) Players: <?= $aInformation['players'] ?>/<?= $aInformation['maxplayers'] ?> ]
<?php
$query->close(); // Close the connection
} else {
echo "Server 1 did not respond!";
}
?>
}
I am trying to get this to work with !players to show information from a SA-MP server as I have both the files linked to my server (website) but I don't think I have done this right,s o any help will be appreciated!
Update
on $*:TEXT:/^\s*\Wplayers?/Si:#: {
set -e %Players $chan
sockclose hits
sockopen hits http://cortanairc.epizy.com/ 80
}
on *:sockopen:hits: {
sockwrite -n $sockname GET players.php HTTP/1.1
sockwrite -n $sockname Host: http://cortanairc.epizy.com/
sockwrite -n $sockname $crlf
}
on *:sockread:hits: {
msg %Players
}
I think this is something but i don't know if it's right? but keeps coming up with 'An Error Has Occured' so must be getting somewhere.
Thanks very much,
Jay.
You can just update it and not to have it to just their name, you can have it to others as well!
on *:TEXT:!awesome:#: {
msg $chan $nick you are $rand(0,100) $+ % awesome!
}
on *:TEXT:!awesome *:#: {
msg $chan $2 is $rand(0,100) $+ % awesome!
}
on *:TEXT:!cool:#: {
msg $chan $nick you are $rand(0,100) $+ $+ % cool!
}
on *:TEXT:!cool *:#: {
msg $chan $2 is $rand(0,100) $+ % cool!
}
on *:TEXT:!epic:#: {
msg $chan $nick today you are looking $rand(0,100) $+ % epic!
}
on *:TEXT:!epic *:#: {
msg $chan $2 is $rand(0,100) $+ % epic!
}
on *:TEXT:!lame:#: {
msg $chan $nick you are $rand(0,100) $+ % lame!
}
on *:TEXT:!lame *:#: {
msg $chan $2 is $rand(0,100) $+ % lame!
}
on *:TEXT:!stupid:#: {
msg $chan $nick today you are $rand(0,100) $+ % stupid!
}
on *:TEXT:!stupid *:#: {
msg $chan $2 is $rand(0,100) $+ % stupid!
}
on *:TEXT:!lucky:#: {
msg $chan $nick today you are $rand(0,100) $+ % lucky!
}
on *:TEXT:!lucky *:#: {
msg $chan $2 is $rand(0,100) $+ % lucky!
}
on *:TEXT:!rip:#: {
msg $chan $nick you have $rand(1,365) days left to live!
}
on *:TEXT:!rip *:#: {
msg $chan $2 has $rand(1,365) days left to live!
}
on *:TEXT:!seljak*:#: {
msg # $nick you are $rand(0,100) $+ % seljak!
}
on *:TEXT:!seljak *:#: {
msg $chan $2 is $rand(0,100) $+ % seljak!
}
on *:TEXT:!gay*:#: {
msg # $nick you are $rand(0,100) $+ % gay!
}
on *:TEXT:!gay *:#: {
msg $chan $2 is $rand(0,100) $+ % gay!
}
on *:TEXT:!retarded*:#: {
msg # $nick you are $rand(0,100) $+ % retarded!
}
on *:TEXT:!retarded *:#: {
msg $chan $2 is $rand(0,100) $+ % retarded!
}