Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-04-2010, 01:29 PM
firefighter firefighter is offline
Registered User
Join Date: Jan 2009
Location: Germany
Posts: 70
firefighter is on a distinguished road
We on Zenox are storing the items in a SQLite database

PHP Code:
public function IncPlayerItemCount(placcitemcount) {
  if (
ItemExists(item)) {
    
temp.ct int(count);
    if (
temp.ct 0) {
      
CreatePlayerItemIfNotExists(placcitem);
      
temp.req GetSQL("UPDATE ItemDB_PlayerItems SET count=count+"@temp.ct@" WHERE player=(SELECT ID FROM Players WHERE Account='"@SQLEscape(placc)@"') AND item=(SELECT ID FROM ItemDB_Items WHERE name='"@SQLEscape(item)@"')",false);
      if (
temp.req!=null && temp.req.error=="")
        return 
true;
      else {
        echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - SQL query error");
        return 
false;
      }
    } else {
      echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - count smaller than 0 or 0");
      return 
false;
    }
  } else {
    echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - item doesnt exist");
    return 
false;
  }

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.