SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/12/2012, 12:16 PM   #1
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,667
Reputation: 118
Exclamation Problem after mysql_fetch_row_format (i thing)

FIXED THANKS
__________________
Quote:
Originally Posted by Kalcor View Post
This my site, so I get to decide what links are allowed. utube and 1e100 are no longer part of my web of trust.

The internet is more important to me than sa-mp. You don't get sa-mp without the internet.
Quote:
Originally Posted by [Twixx] View Post
That's kind of hypocritical of you to say. Sure you own the website, but it's not your personal blog or something - it's a community driven forum. The community should be the primary focus, not your personal agendas. Just like you don't get SA-MP without internet, you don't get SA-MP forums without community.

Just wiping out years worth of people's work and creations posted on that board because a bunch of people bypassed your Tube ban is absurd.
Quote:
Originally Posted by Mauzen View Post
"tube sucks cause they delete 6 years old videos for no reason!"

*deletes every single video ever posted here in 12 years*

Last edited by doreto; 04/01/2013 at 02:42 PM.
doreto is offline   Reply With Quote
Old 30/12/2012, 01:54 PM   #2
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 2,630
Reputation: 409
Default Re: Problem after mysql_fetch_row_format

For starters it should be

pawn Code:
SecondsToDHMS (dbt - times, days, hours, mins, sec);

but it probably won't return a exact integer value such as 3 days. It is going to return a float.

You should just do the following:
pawn Code:
new time = floatround((dbt - times) / 86400), floatround_ceil);
__________________
[HiC]TheKiller is offline   Reply With Quote
Old 30/12/2012, 02:31 PM   #3
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,667
Reputation: 118
Default Re: Problem after mysql_fetch_row_format

Quote:
Originally Posted by [HiC]TheKiller View Post
For starters it should be

pawn Code:
SecondsToDHMS (dbt - times, days, hours, mins, sec);

but it probably won't return a exact integer value such as 3 days. It is going to return a float.

You should just do the following:
pawn Code:
new time = floatround((dbt - times) / 86400), floatround_ceil);
pawn Code:
SecondsToDHMS (dbt - times, days, hours, mins, sec);

You are right about it , but i also try that ,but the problem its still say this time its show -value(-15705)


pawn Code:
new time = floatround((dbt - times) / 86400), floatround_ceil);
Same result as above -15705.

Im starting to thing there is a bug/problem after mysql_fetch_row_format becose i've predefine value (at PlayerInfo[playerid][pUtime]) and when i convert it after while loop its show correct days so i doubt the problem its somewere else , but thanks for ideas i appreciate it
__________________
Quote:
Originally Posted by Kalcor View Post
This my site, so I get to decide what links are allowed. utube and 1e100 are no longer part of my web of trust.

The internet is more important to me than sa-mp. You don't get sa-mp without the internet.
Quote:
Originally Posted by [Twixx] View Post
That's kind of hypocritical of you to say. Sure you own the website, but it's not your personal blog or something - it's a community driven forum. The community should be the primary focus, not your personal agendas. Just like you don't get SA-MP without internet, you don't get SA-MP forums without community.

Just wiping out years worth of people's work and creations posted on that board because a bunch of people bypassed your Tube ban is absurd.
Quote:
Originally Posted by Mauzen View Post
"tube sucks cause they delete 6 years old videos for no reason!"

*deletes every single video ever posted here in 12 years*
doreto is offline   Reply With Quote
Old 31/12/2012, 09:56 AM   #4
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,667
Reputation: 118
Default Re: Problem after mysql_fetch_row_format

Still havent way to fix it . Thanks
__________________
Quote:
Originally Posted by Kalcor View Post
This my site, so I get to decide what links are allowed. utube and 1e100 are no longer part of my web of trust.

The internet is more important to me than sa-mp. You don't get sa-mp without the internet.
Quote:
Originally Posted by [Twixx] View Post
That's kind of hypocritical of you to say. Sure you own the website, but it's not your personal blog or something - it's a community driven forum. The community should be the primary focus, not your personal agendas. Just like you don't get SA-MP without internet, you don't get SA-MP forums without community.

Just wiping out years worth of people's work and creations posted on that board because a bunch of people bypassed your Tube ban is absurd.
Quote:
Originally Posted by Mauzen View Post
"tube sucks cause they delete 6 years old videos for no reason!"

*deletes every single video ever posted here in 12 years*
doreto is offline   Reply With Quote
Old 01/01/2013, 12:17 PM   #5
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,667
Reputation: 118
Default Re: Problem after mysql_fetch_row_format

New day and still wont work normal
__________________
Quote:
Originally Posted by Kalcor View Post
This my site, so I get to decide what links are allowed. utube and 1e100 are no longer part of my web of trust.

The internet is more important to me than sa-mp. You don't get sa-mp without the internet.
Quote:
Originally Posted by [Twixx] View Post
That's kind of hypocritical of you to say. Sure you own the website, but it's not your personal blog or something - it's a community driven forum. The community should be the primary focus, not your personal agendas. Just like you don't get SA-MP without internet, you don't get SA-MP forums without community.

Just wiping out years worth of people's work and creations posted on that board because a bunch of people bypassed your Tube ban is absurd.
Quote:
Originally Posted by Mauzen View Post
"tube sucks cause they delete 6 years old videos for no reason!"

*deletes every single video ever posted here in 12 years*
doreto is offline   Reply With Quote
Old 02/01/2013, 11:56 AM   #6
AndreT
Gangsta
 
AndreT's Avatar
 
Join Date: Jul 2011
Posts: 966
Reputation: 413
Default Re: Problem after mysql_fetch_row_format

I appreciate you PMing me, here are a few suggestions:
1. Do not use the loop. You explicitly are dealing with one ROW of data only, so the looping is not necessary. Additionally you could (perhaps should, depending on your system design) add a LIMIT 1 clause to the query.
2. Select only the necessary fields - SELECT field1,field2,field3,... FROM table (in your case, SELECT unban_time,reason FROM bans WHERE ...)
(3. Use better means of parsing. Your current method is slow and most likely working, but maybe not.)

Also jesus christ I've never seen a function such as SecondsToDHMS. It keeps on carrying the initial calculation on to the others - I don't think that's very good given the fact that PAWN is slow on calculations in the first place.
AndreT is offline   Reply With Quote
Old 04/01/2013, 12:02 PM   #7
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,667
Reputation: 118
Default Re: Problem after mysql_fetch_row_format

Its still the same problem , even i try wich [HiC]TheKiller convertion
pawn Code:
new time = floatround((dbt - times) / 86400), floatround_ceil);
__________________
Quote:
Originally Posted by Kalcor View Post
This my site, so I get to decide what links are allowed. utube and 1e100 are no longer part of my web of trust.

The internet is more important to me than sa-mp. You don't get sa-mp without the internet.
Quote:
Originally Posted by [Twixx] View Post
That's kind of hypocritical of you to say. Sure you own the website, but it's not your personal blog or something - it's a community driven forum. The community should be the primary focus, not your personal agendas. Just like you don't get SA-MP without internet, you don't get SA-MP forums without community.

Just wiping out years worth of people's work and creations posted on that board because a bunch of people bypassed your Tube ban is absurd.
Quote:
Originally Posted by Mauzen View Post
"tube sucks cause they delete 6 years old videos for no reason!"

*deletes every single video ever posted here in 12 years*
doreto is offline   Reply With Quote
Old 04/01/2013, 12:21 PM   #8
Roel
Gangsta
 
Join Date: Mar 2012
Location: Netherlands, Limburg
Posts: 727
Reputation: 229
Default Re: Problem after mysql_fetch_row_format

Why are you making it yourself so hard, if SQL includes all functions that you need,
I show you how I make temporary bans,
First you create a column in your ban table with is type; timestamp
Then you insert a ban like:

Code:
 INSERT INTO `bans`(`username`, `start_date`, `expire_date`) VALUES ('%s', NOW(), NOW()+INTERVAL 10 DAY)
Now you banned this person for 3 days.

Then when the players connect and you check if he is banned, and when it expires you simply use thigs:

Code:
SELECT *,UNIX_TIMESTAMP(expire_date) AS timestamp FROM `bans` WHERE `username` = '%s' AND `IP` = '%s' AND `banned` = 1
Then you put this timestamp in a variable (int)
Then you use
pawn Code:
new timestamp;
// put your 'timestamp' from the sql results inside the timestamp variable.
if(timestamp < gettime())
{
// the player should get unbanned because it's expired
}
else
{
// players should get kicked because he is still banned.
}
Roel is offline   Reply With Quote
Old 04/01/2013, 01:03 PM   #9
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 874
Reputation: 303
Default Re: Problem after mysql_fetch_row_format

http://forum.sa-mp.com/showthread.php?t=394765

Take a look.
Djole1337 is offline   Reply With Quote
Reply

Thread Tools
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using mysql_fetch_row_format in a threaded query NewerthRoleplay Scripting Help 1 30/10/2012 03:08 PM
[MySQL] mysql_fetch_row_format function. iansinho Scripting Help 0 03/07/2012 02:18 AM
Wanted problem and neon system problem iRealSAMP Scripting Help 4 04/02/2012 07:22 PM
To retrieve a string from a MySQL database without mysql_fetch_row_format? Carlton Help Archive 9 20/06/2010 12:06 PM


All times are GMT. The time now is 05:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.