Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- // vma_getStatus($vma_ip)
- // get status server return: "true / error"
- //
- // vma_getVersion($vma_ip)
- // get version server return: "ex: 1.8.6"
- //
- // vma_getMotd($vma_ip)
- // get MOTD server return: "ex: FREE SERVER ONLY"
- //
- // vma_getPlayer($vma_ip, $arg1)
- // get Player only and get Player max $arg1 = max / only
- //
- // vma_getList($vma_ip)
- // get Player list of server
- //
- // vma_getIcon($vma_ip)
- // get server icon
- //
- // vma_get2dAvatar($vma_name, $vma_size)
- // get 2d avatar of player "vma_get2dAvatar('volca780', '200')" return: img link
- //
- // vma_get3dAvatar($vma_name, $vma_size)
- // get 3d avatar of player "vma_get2dAvatar('volca780', '200')" return: img link
- //
- // vma_get3dSkin($vma_name, $vma_size)
- // get 3d skin of player "vma_get3dAvatar('volca780', '200')" return: img link
- //
- // vma_getUuid($vma_name, $arg1)
- // get UUID of player $arg1 = F for get UUID FORMATTED and use O for get UUID
- //
- // vma_getName($vma_uuid)
- // get Name from UUID
- //
- // vma_getPremium($vma_name)
- // get if the player as premium return: true / false
- */
- function vma_getStatus($vma_ip){
- $vma_ip_test = file_get_contents("http://mcapi.ca/query/".$vma_ip."/status");
- $vma_ip_test = json_decode($vma_ip_test);
- if(!isset($vma_ip_test->error)){
- return true;
- }else{
- echo "error: ".$vma_ip_test->error;
- }
- }
- function vma_getVersion($vma_ip){
- if(vma_getStatus($vma_ip) == true){
- $vma_ip_version = file_get_contents("http://mcapi.ca/query/".$vma_ip."/info");
- $vma_ip_version = json_decode($vma_ip_version);
- if(!empty($vma_ip_version->version) AND isset($vma_ip_version->version)){
- return $vma_ip_version->version;
- }
- }
- }
- function vma_getMotd($vma_ip){
- if(vma_getStatus($vma_ip) == true){
- $vma_ip_Motd = file_get_contents("http://mcapi.ca/query/".$vma_ip."/motd");
- $vma_ip_Motd = json_decode($vma_ip_Motd);
- if(!empty($vma_ip_Motd) AND isset($vma_ip_Motd)){
- return nl2br($vma_ip_Motd->motd);
- }
- }
- }
- function vma_getPlayer($vma_ip, $arg1){
- if(vma_getStatus($vma_ip) == true){
- $vma_ip_player = file_get_contents("http://mcapi.ca/query/".$vma_ip."/players");
- $vma_ip_player = json_decode($vma_ip_player);
- if(isset($vma_ip_player->players)){
- if($arg1 === "max"){
- return $vma_ip_player->players->max;
- }else if($arg1 == "online"){
- return $vma_ip_player->players->online;
- }
- }
- }
- }
- function vma_getList($vma_ip){
- if(vma_getStatus($vma_ip) == true){
- $vma_ip_list = file_get_contents("http://mcapi.ca/query/".$vma_ip."/list");
- $vma_ip_list = json_decode($vma_ip_list);
- if(isset($vma_ip_list->players)){
- return $vma_ip_list->players->list;
- }
- }
- }
- function vma_getIcon($vma_ip){
- if(vma_getStatus($vma_ip) == true){
- $vma_ip_icon = "http://mcapi.ca/query/".$vma_ip."/icon";
- return $vma_ip_icon;
- }
- }
- function vma_get2dAvatar($vma_name, $vma_size){
- if(!empty($vma_name) AND !empty($vma_size)){
- $vma_avatar = "http://mcapi.ca/avatar/2d/".$vma_name."/".$vma_size;
- return $vma_avatar;
- }
- }
- function vma_get3dAvatar($vma_name, $vma_size){
- if(!empty($vma_name) AND !empty($vma_size)){
- $vma_avatar = "http://mcapi.ca/avatar/3d/".$vma_name."/".$vma_size;
- return $vma_avatar;
- }
- }
- function vma_get3dSkin($vma_name, $vma_size){
- if(!empty($vma_name) AND !empty($vma_size)){
- $vma_avatar = "http://mcapi.ca/skin/3d/".$vma_name."/".$vma_size;
- return $vma_avatar;
- }
- }
- function vma_getUuid($vma_name, $arg1){
- if(isset($vma_name)){
- $vma_ip_uuid = file_get_contents("http://mcapi.ca/uuid/player/".$vma_name);
- $vma_ip_uuid = json_decode($vma_ip_uuid);
- if($arg1 === "F"){
- return $vma_ip_uuid->uuid_formatted;
- }else if($arg1 === "O"){
- return $vma_ip_uuid->uuid;
- }
- }
- }
- function vma_getName($vma_uuid){
- if(isset($vma_uuid)){
- $vma_ip_name = file_get_contents("http://mcapi.ca/name/uuid/".$vma_uuid);
- $vma_ip_name = json_decode($vma_ip_name);
- if(isset($vma_ip_name->name) AND !empty($vma_ip_name->name)){
- return $vma_ip_name->name;
- }
- }
- }
- function vma_getPremium($vma_name){
- if(isset($vma_name) AND isset($vma_name)){
- $vma_ip_premium = file_get_contents("http://mcapi.ca/other/haspaid/".$vma_name);
- $vma_ip_premium = json_decode($vma_ip_premium);
- if(isset($vma_ip_premium->premium) AND !empty($vma_ip_premium->premium)){
- return true;
- }else{
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement