Prop Problem

Started by FarisDon, Jul 12, 2015, 12:09 PM

Previous topic - Next topic

FarisDon

Well i don't know what to do now when i pickup the prop id 2 it shows me the prop id 1 and when i pickup prop id 1 it shows me nothing how to fix that?In DB everything is arranged accordingly #1 ID:1 Name:Mansion Owner:None Share...... then why ?
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Props ( ID NUMERIC, Name VARCHAR(32), Cost VARCHAR(25), Owner TEXT, Shared TEXT, Pos VARCHAR(25)  )" );
[code]
I even use this and the other command given by the__endz to add pickup :/ don't worry i modified it
[code]
function LoadPickups()
{
    try{
 
 if ( CountProps() != 0 )
 {
     local q = QuerySQL( db, "SELECT ID, Name, Cost, Owner, Shared, Pos FROM Props" ), pos;
     while( GetSQLColumnData( q, 0 ) )
     {
        local coords = GetSQLColumnData( q, 5 );
     local pos = split( coords, " " );
     local x = pos[0], y = pos[1], z = pos[2];
     CreatePickup( 407, Vector( x.tofloat(), y.tofloat(), z.tofloat() ) );
     GetSQLNextRow( q );
     }
           
 }   
P.S:Sorry thijn i read it , but i didn't get any important answer to solve this problem as Shawn was unable to give correct errors and etc.
Request:please don't lock this topic because i am unable to solve it even i need your guys help :(

Thijn

Your pickup IDs don't match. It's that simple.
Either save the pickup IDs when you create them onScriptLoad, or set an offset.

FarisDon

#2
Quote from: Thijn on Jul 12, 2015, 12:41 PMYour pickup IDs don't match. It's that simple.
Either save the pickup IDs when you create them onScriptLoad, or set an offset.
Well what you mean by to save them in onscriptload any example or something kindly?because i am already saving them through command and etc.Edit:i think you mean to create them on onscriptload  as like CreatePickup....... but it would take too much time and i need to make much functions right you mean that?and if that so what you mean by offset any example?

Mashreq

Try adding a random pickup to onscriptload before loading the props.

Thijn

Pickup IDs start at 1. Rowids start at 0. You see your problem?
Either decrease the pickup ID by 1 when querying your database, or add a random pickup first.

[VSS]Shawn

same problem with me when i rob bank it say u rob cuban cafe Lol
But i set it by secret way XD in database

EK.IceFlake

Quote from: FarisDon on Jul 12, 2015, 12:09 PMWell i don't know what to do now when i pickup the prop id 2 it shows me the prop id 1 and when i pickup prop id 1 it shows me nothing how to fix that?In DB everything is arranged accordingly #1 ID:1 Name:Mansion Owner:None Share...... then why ?
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Props ( ID NUMERIC, Name VARCHAR(32), Cost VARCHAR(25), Owner TEXT, Shared TEXT, Pos VARCHAR(25)  )" );
[code]
I even use this and the other command given by the__endz to add pickup :/ don't worry i modified it
[code]
function LoadPickups()
{
    try{
 
 if ( CountProps() != 0 )
 {
     local q = QuerySQL( db, "SELECT ID, Name, Cost, Owner, Shared, Pos FROM Props" ), pos;
     while( GetSQLColumnData( q, 0 ) )
     {
        local coords = GetSQLColumnData( q, 5 );
     local pos = split( coords, " " );
     local x = pos[0], y = pos[1], z = pos[2];
     CreatePickup( 407, Vector( x.tofloat(), y.tofloat(), z.tofloat() ) );
     GetSQLNextRow( q );
     }
           
 }   
P.S:Sorry thijn i read it , but i didn't get any important answer to solve this problem as Shawn was unable to give correct errors and etc.
Request:please don't lock this topic because i am unable to solve it even i need your guys help :(
You gave everything except for what is important. GIVE ONPICKUPPOCKEDUP!

FarisDon

Quote from: Thijn on Jul 12, 2015, 12:41 PMYour pickup IDs don't match. It's that simple.
Either save the pickup IDs when you create them onScriptLoad, or set an offset.
Quote from: Thijn on Jul 12, 2015, 12:54 PMPickup IDs start at 1. Rowids start at 0. You see your problem?
Either decrease the pickup ID by 1 when querying your database, or add a random pickup first.
Thank YOU VERY MUCH THIJN!!!!!!!! YOU SOLVED MY PROBLEM WHICH WAS ANNOYING ME SINCE 9 hours :P :) thank you buddy
Quote from: [VSS]Shawn on Jul 12, 2015, 01:00 PMsame problem with me when i rob bank it say u rob cuban cafe Lol
But i set it by secret way XD in database
Hey Shawn! Stop increasing your posts.This room is for help and learning not for joking and increasing.