Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query = $_GET['id'];
- $imageQuery = $_GET['image'];
- $blurQuery= $_GET['blur'];
- $primary= $_GET['primary'];
- $secondary= $_GET['secondary'];
- $tertiary= $_GET['tertiary'];
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => "https://api.roleplay.co.uk/v1/player/".$query,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "GET",
- CURLOPT_HTTPHEADER => array(
- "cache-control: no-cache"
- ),
- ));
- $api= curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- $api= json_decode($api, true);
- $blur = false;
- if ($blurQuery == "true") {
- $blur = "blur";
- } else {
- $blur = "";
- }
- $imageLink = "images/background1.png";
- if ($imageQuery > 1 && $imageQuery < 5) {
- $imageLink = "images/background".$imageQuery.$blur.".png";
- } else {
- $imageLink = "images/background1.png";
- }
- $primaryColor = #21b1ff;
- $secondaryColor= #21b1ff;
- $tertiaryColor= #ffffff;
- $name = $api['name'];
- $cash = $api['cash'];
- $bank = $api['bank'];
- $totalCash = "£".number_format($cash+$bank);
- $vehicles= count($api['vehicles']);
- header('Content-Type: image/png;');
- $im = @imagecreatefrompng($imageLink) or die("Didn't work - contact Ant Arni");
- imagettftext($im, 35, 0, 20, 63, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Bold.ttf', $name);
- imagettftext($im, 20, 0, 20, 120, imagecolorallocate($im, 255, 255, 255), 'OpenSans-Regular.ttf', "I have");
- imagettftext($im, 20, 0, 100, 120, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Regular.ttf', $totalCash);
- imagettftext($im, 20, 0, 20, 160, imagecolorallocate($im, 255, 255, 255), 'OpenSans-Regular.ttf', "I own");
- imagettftext($im, 20, 0, 100, 160, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Regular.ttf', $vehicles." vehicles");
- imagepng($im);
- imagedestroy($im);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment