|  02-11-2012, 11:42 PM | #1 | 
	| 
 
 
 
 
 
	| 
 |  | • الانـتـسـاب » Nov 2009 |  | • رقـم العـضـويـة » 65691 |  | • المشـــاركـات » 288 |  | • الـدولـة » Alexandria |  | • الـهـوايـة » Dev-Datebase-SQL |  | • اسـم الـسـيـرفـر » |  | • الـجـنـس » |  | • نقـاط التقييم » 10 |  |  |  
  
 
 
 | 
 
 
 
	كود PHP: 
		
			
USE [SRO_VT_ACCOUNT]
GO
 
 /****** Object:  Table [dbo].[Coints]    Script Date: 11/02/2012 15:00:06 ******/
 SET ANSI_NULLS ON
 GO
 
 SET QUOTED_IDENTIFIER ON
 GO
 
 SET ANSI_PADDING ON
 GO
 
 CREATE TABLE [dbo].[Coints](
 [LoginID] [varchar](max) NULL,
 [coints] [varchar](max) NULL
 ) ON [PRIMARY]
 
 GO
 
 SET ANSI_PADDING OFF
 GO
 
Other Files 
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ] 
	كود PHP: 
		
			
الشرح
How to:
 First you will need an Login Panel who is using $userID = $_SESSION['name'];
 Insert into the DB DB.txt
 Change
 $serverIp = "local";
 $userName = "sa";
 $password = "PW";
 $dbName1 = "SRO_VT_ACCOUNT";
 $dbName2 = "SHARD";
 to your data
 
 
 How to add items:
 You will see in buy.php
 
 
 echo 'Global 10x<br />'; //Item
 echo '<img src="img/global.jpg" title="Global" /><br />'; //Image
 echo 'Price: 10coints<br />'; //Cost
 print " //Select char start
 <b>Select Char</b>
 <br />
 <form name='form' method='post' action='?Item'>
 <select name='CharName'>
 <option value='$CharNAME'>$CharNAME</option>
 <option value='$CharNAME1'>$CharNAME1</option>
 <option value='$CharNAME2'>$CharNAME2</option>
 </select>
 <input type='submit' class='button' value='Buy' name='item1' /> //name='item1' is needed for item.php
 </form>
 "; //Select char end
 echo ' <br />';
 
 
 
 Just change all this things for a new item
 
 Now item.php
 
 if (isset($_POST['item1'])) { //item1 from the buy.php
 
 
 
 
 
 if ($coint > 9) { //how much coints its cost -1
 
 
 mssql_query("update Coints set coints = coints - 10 where loginid = '$userID'"); //Delete coints from DB how much its cost
 
 mssql_select_db($dbName2, $dbConn) or die ("Couln't select database $dbName1");
 mssql_query("exec _ADD_ITEM_EXTERN '$Char','ITEM_EVENT_RENT_GLOBAL_CHATTING',10,1"); //$Char,item,units,item option level
 
 
 echo "Succesfull buyed item pls check your inventory for the item";
 
 
 }else{
 echo "You have not enugh coints";
 }
 
 }
 
 
 If you want to add a new item you will need to change name='item1' and if (isset($_POST['item1'])) { lets we say you have added already 9 items then you will need for the next item name='item10' and if (isset($_POST['item10'])) {
 
 
 Where i get the icons?
 Go into your media then icons item etc.....
 
 
 | 
    |  | 
 
                
                    
                        التعديل الأخير تم بواسطة N00b™ ; 03-11-2012 الساعة 06:11 PM
                    
                    
                
             
   |