if someone could help me with this problem my script would finally be complete and i can move onto my next project, thanks =]
Here are my script and php code
!---------------------------------------SL SCRIPT------------------------------------------!
key req_id1;
key req_id2;
string lname;
integer lpc;
integer gpc;
key cid;
integer creatoramount;
integer amountleft;
default
{
state_entry()
{
cid = llGetCreator();
creatoramount = 200;
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
llSetPayPrice(PAY_HIDE, [250, 500, 750, 1000]);
llSetTimerEvent(10.0);
}
timer() {
llSetText("Updating Stats...", <0.0,1.0,0.0>, 1);
req_id1 = llHTTPRequest("http://kklouzal.awardspace.com/secondchk.php", [HTTP_METHOD, "GET"], ""
;}
http_response(key request_id, integer status, list metadata, string body) {
if (request_id == req_id2) {
llSetText("Raffle Tickets $L250\n" + (string)amountleft + "Tickets Left\nCurrent Local Players: " + (string)lpc + "\nCurrent Global Players: " + (string)gpc, <0.0,1.0,0.0>, 1);
}
if (request_id == req_id1) {
gpc = (integer)body;
amountleft = 10000 - (integer)body;
llSetText("Raffle Tickets $L250\n" + (string)amountleft + "Tickets Left\nCurrent Local Players: " + (string)lpc + "\nCurrent Global Players: " + (string)gpc, <0.0,1.0,0.0>, 1);
}
}
money(key id, integer amount)
{
llSetText("Adding " + lname + " To Player Roster...", <0.0,1.0,0.0>, 1);
llGiveMoney(cid, creatoramount);
lname = llKey2Name(id);
req_id2 = llHTTPRequest("http://kklouzal.awardspace.com/secondcom.php", [HTTP_METHOD, "GET", HTTP_MIMETYPE, "x-www-form-urlencoded"], "name=" + lname + "&id=" + (string)id);
++lpc;
}
}
!-----------------------------------------PHP CODE-----------------------------------!
<?
$username="kklouzal_account";
$password="********";
$database="db4.awardspace.com";
$db="kklouzal_account";
$name = $_GET['name'];
$key = $_GET['id'];
mysql_connect($database,$username,$password);
@mysql_select_db($db) or die( "Unable to select database"
;$query = "INSERT INTO accounts VALUES ('', $name, $key)";
mysql_query($query);
mysql_close();
?>