יוצר: intersys
גירסא: בטא
תיאור: קבלת מידע משרת sa:mp (San-Andress:Multi Player)
הפעלה:
קוד: בחר הכל
/samp [ip-server]
תמונה:
הקוד:
קוד: בחר הכל
alias sampinfo {
sockclose sampinfo
set %samip $1
var %ip = $gettok($1,1,58) , %port = $gettok($1,2,58)
bset &gq 1 $chr(83) $chr(65) $chr(77) $chr(80) $replace(%ip,.,$chr(32)) $int($calc(%port / 256)) $calc(%port % 256) $asc(i)
sockudp -k sampinfo $replace(%samip,$chr(58),$chr(32)) &gq
}
on *:UDPREAD:sampinfo:{
sockread &gr
set %samp.players $bvar(&gr,13).word $+ / $+ $bvar(&gr,15).word
var %off = 17, %len = $bvar(&gr,%off).long, %off = %off + 4
set %samp.hostname $bvar(&gr,%off,%len).text
var %off = %off + %len, %len = $bvar(&gr,%off).long, %off = %off + 4
set %samp.gamemode $bvar(&gr,%off,%len).text
var %off = %off + %len, %len = $bvar(&gr,%off).long, %off = %off + 4
set %samp.mapname $bvar(&gr,%off,%len).text
}
dialog SAMP {
title "SA:MP Server info By intersys"
size -1 -1 165 90
option dbu
text "SA:MP Server Info By intersys", 1, 44 9 75 9, center
text "ip:", 2, 3 22 11 8, center
edit "", 3, 16 22 52 10, read
text "Players:", 4, 75 23 25 8, center
edit "", 5, 106 22 53 10, read
text "Hostname:", 6, 3 40 26 8, center
edit "", 7, 32 39 127 10, read
text "Mode:", 8, 3 58 17 8, center
edit "", 9, 22 57 50 10, read
text "Map:", 10, 75 58 21 8, center
edit "", 11, 97 57 61 10, read
button "Refresh", 12, 22 74 37 9
button "Change ip", 13, 66 74 37 9
button "Close", 14, 110 74 37 9
}
alias samp {
if (!$1) { echo -ag Error! Syntax: /samp [ip-server] }
else { set %samip $1 | sampinfo %samip | .echo -ag Get info server from %samip $+ , Please Wait... | .timer 1 2 dialog -m samp samp }
}
on *:dialog:samp:init:0: {
showsamp
}
on *:dialog:samp:sclick:*:{
if ($did == 12) { showsamp }
elseif ($did == 13) { set %samip $$? | showsamp }
elseif ($did == 14) { dialog -x $dname }
}
alias showsamp {
did -r $dname 3,5,7,9,11
sampinfo %samip
did -a $dname 5 %samp.players
did -a $dname 7 %samp.hostname
did -a $dname 9 %samp.gamemode
did -a $dname 11 %samp.mapname
did -a $dname 3 %samip
}