SA-MP Forums Archive
Ban List Questions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Ban List Questions (/showthread.php?tid=165378)



Ban List Questions - ScottCFR - 04.08.2010

Is there a way to display my ban list on my forum/site?

I just want it to show the Name and Time of ban... I know it's possible, but that's a lot of coding that I don't want to do if I don't have to.


Re: Ban List Questions - WackoX - 04.08.2010

Yes, make your ban system on MySQL and use the php example.


Re: Ban List Questions - ScottCFR - 04.08.2010

Yeh, I got the PHP part. and the query set.

How/Where can I get something for dob (Date of Ban)?

Like, it would show 8/04/10?

Код:
stock CreateBan(playerid)
{
	new query[512],name[MAX_PLAYER_NAME]+1;
	GetPlayerName(playerid, name, sizeof(name));
	format(query, sizeof(query),"INSERT INTO bans (name, dob) VALUES ('%s', '%s')",name,dob);
	mysql_query(query);
	return 1;
}



Re: Ban List Questions - Carlton - 04.08.2010

pawn Код:
stock CreateBan(playerid)
{
    new query[128],name[MAX_PLAYER_NAME]+1;
    GetPlayerName(playerid, name, sizeof(name));
    new Hour, Minute, Second;
    gettime(Hour, Minute, Second);
    format(query, sizeof(query),"INSERT INTO bans (name, dob) VALUES ('%s', %02d:%02d:%02d)",name,Hour, Minute, Second);
    mysql_query(query);
    return 1;
}



Re: Ban List Questions - [NoV]LaZ - 04.08.2010

pawn Код:
stock CreateBan(playerid)
{
    new query[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(query, sizeof(query),"INSERT INTO bans (name, dob) VALUES ('%s', NOW())",name);
    mysql_query(query);
    return 1;
}
________
MEDICAL MARIJUANA PATIENT


Re: Ban List Questions - ScottCFR - 04.08.2010

Thanks, Carlton && WackoX

Used code the Carlton gave me. Compiled fine, didn't post. And got an error: in my logs




Re: Ban List Questions - Daren_Jacobson - 04.08.2010

using day-month-year not second-minute-hour, it makes more sense
pawn Код:
stock CreateBan(playerid)
{
    new query[128],name[MAX_PLAYER_NAME]+1;
    GetPlayerName(playerid, name, sizeof(name));
    new Year, Month, Day;
    getdate(Year, Month, Day);
    format(query, sizeof(query),"INSERT INTO `bans` (`name`, `dob`) VALUES ('%s', '%02d-%02d-%02d');",name,Day,Month,Year);
    mysql_query(query);
    return 1;
}



Re: Ban List Questions - ScottCFR - 04.08.2010

What did you change?

I don't wanna take code and not understand how to do it next time.


Re: Ban List Questions - Daren_Jacobson - 04.08.2010

I added proper SQL syntax, and changed it to day-month-year.


Re: Ban List Questions - ScottCFR - 04.08.2010

What does this mean:

Quote:

[14:25:13] MySQL Error (0): Could not execute query. Data truncated for column 'dob' at row 1.

?