Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //javascripts for trading in the game
- //array of your properties
- var Pyours = new Array();
- //array of their properties
- var Ptheirs = new Array();
- //Variable to hold the cash transpher +=>you gain -=>them gain
- var Transcash = 0;
- //variable to hold get out of jail free cards +=>you gain -=>them gain
- var Tliberty = 0;
- //add a property to the list they would be giving up in the trade
- function offerprop(id){
- if(Pyours[i]=False){
- Pyours[i]=True;
- }else{
- Pyours[i]=False;
- }
- }
- //add a property to the list of properties they would recive in a traid
- function requestprop(id){
- if(Ptheirs[i]=False){
- Ptheirs[i]=True;
- }else{
- Ptheirs[i]=False;
- }
- }
- //if the try to include a property they don't own
- function badoffer(){
- alert('You can only traid with properties you own and that are not built upon!')
- }
- function moremoney(){
- Transcash = Transcash + 100;
- if(Transcash>0){
- var x=document.getElementById("moneyfromme");
- x.innerHTML = 0;
- x=document.getElementById("moneytome");
- x.innerHTML = Transcash;
- }else{
- var x=document.getElementById("moneyfromme");
- x.innerHTML = Transcash*-1;
- x=document.getElementById("moneytome");
- x.innerHTML = 0;
- }
- }
- function lessmoney(){
- Transcash = Transcash - 100;
- if(Transcash>0){
- var x=document.getElementById("moneyfromme");
- x.innerHTML = 0;
- x=document.getElementById("moneytome");
- x.innerHTML = Transcash;
- }else{
- var x=document.getElementById("moneyfromme");
- x.innerHTML = Transcash*-1;
- x=document.getElementById("moneytome");
- x.innerHTML = 0;
- }
- }
- function generateprop(id1,id2,gid){
- //generate prop1 and prop2
- var prop1 = "";
- var prop2 = "";
- //cash transfure
- if(Transcash!=0){
- prop1 = "$" + Transcash + ";" ;
- prop2 = "$" + (-1 * Transcash) + ";";
- }
- //get out of jail transfure
- if(Tliberty>0){
- for(i=0;i<Tliberty;i++){
- prop2 = prop2 + "gooj;";
- }}
- if(Tliberty<0){
- for(i=0;i<Tliberty;i++){
- prop1 = prop1 + "gooj;";
- }}
- //property transpher
- for (i=0;i<39;i++){
- if(Pyours[i]!=null){
- prop1 = prop1 + "p" + i + ";";
- }if(Ptheirs[i]!=null){
- prop2 = prop2 + "p" + i + ";";
- }
- }
- //send request
- var xmlhttp;
- if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp=new XMLHttpRequest();
- }
- else{// code for IE6, IE5
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange=function(){
- if (xmlhttp.readyState==4 && xmlhttp.status==200){
- var resp;
- resp=xmlhttp.responseText;
- }
- }
- xmlhttp.open("GET","noti.php?id=" + gid + "&id1=" + id1 + "&id2=" + id2 + "acpt=False",true);
- xmlhttp.send();
- }
- function trade(gid,uid){
- loading();
- var xmlhttp;
- if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp=new XMLHttpRequest();
- }
- else{// code for IE6, IE5
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange=function(){
- if (xmlhttp.readyState==4 && xmlhttp.status==200){
- var resp = xmlhttp.responseText;
- document.getElementById("the").innerHTML=resp;
- }
- }
- xmlhttp.open("GET","tradesfriend.php?gid=" + gid + "&uid=" + uid ,true);
- xmlhttp.send();
- }
- function splayerstraid(uid,id,gid){
- loading();
- var req = "tradingfloor.php?gid=" + gid + "&uid=" + uid + "&id=" + id;
- var xmlhttp;
- if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp=new XMLHttpRequest();
- }
- else{// code for IE6, IE5
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange=function(){
- if (xmlhttp.readyState==4 && xmlhttp.status==200){
- var resp = xmlhttp.responseText;
- document.getElementById("the").innerHTML=resp;
- }
- }
- xmlhttp.open("GET",req,true);
- xmlhttp.send();
- }
- //code used in the tradesfriend script to make the pictures have a yellow border onmousover
- function createbd(id){
- $("#" + id).css({"border-style":"solid","border-width":"5px"});
- }
- function erasebd(id){
- $("#" + id).css({"color":"black","border":"0","border-color":"yellow"});
- }
Advertisement
Add Comment
Please, Sign In to add comment