Pickup Problem.

Started by FarisDon, Jul 12, 2015, 09:23 AM

Previous topic - Next topic

FarisDon

function onPickupPickedUp( player, pickup )
{
   pickup.Timer = 6000;
  if( pickup.Model == 407 )
        try{

    pickup.Timer = 200;
{
    local q = QuerySQL( db, "SELECT * FROM Props WHERE rowid='" + pickup.ID + "'" );
if ( q )
{
ClientMessage( "===> " + GetSQLColumnData( q, 0 ) + " <===",player,255,255,0);
ClientMessage( "ID:[ " + pickup.ID + " ] Name:[ " + GetSQLColumnData( q, 1 ) + " ] Cost:[ $" + GetSQLColumnData( q, 2 ) + " ] Owner:[ " + GetSQLColumnData( q, 3 ) + " ] Share:[ " + GetSQLColumnData( q, 4 ) + " ]",player,255,255,0);
    }
}

}
catch(e) print( "OnPickupPick Error: " + e );
}
Well as you can see the Code their is no error in it , and the consol even doesn't show any error , but! ._. when i pick up the pickup 407 it shows me nothing else re spawning o.0 whats that guys?
Edit: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)  )" );I even use this and the other command given by the__endz to add pickup :/ don't worry i modified it
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],cptype = GetSQLColumnData( q, 6 );
   CreatePickup( 408, Vector( x.tofloat(), y.tofloat(), z.tofloat() ) );
   GetSQLNextRow( q );
    }
           
}   
}
catch(e) print( "function LoadPickups() error: " + e );
}

Thijn

Locked. This has been asked before, search before posting.