presentation system
#5

Quote:
Originally Posted by CuervO
Посмотреть сообщение
If you want for such variables to save, then SQL would be the best way to store player relationships.
(relationships table: one column AND one row per every player)

Layout:

pawn Код:
player  BOB     CHRIS   JOE

BOB     null    1       0
CHRIS   1       null    1
JOE     0       1       null


Bob knows Chris, and doesn't know joe
Chris knows both bob and joe
Joe doesn'
t know bob but knows chris
Example

SELECT * FROM `relationships` WHERE `player` = 'BOB' AND `CHRIS` = 1

If there's any result then bob is a friend of chris, else, they are not friends.
You're doing SQL wrong! Your table should only need 2 columns, not as many columns as you have players - that's not what SQL is designed for!
Reply


Messages In This Thread
presentation system - by Slicebook - 11.02.2014, 22:12
Re: presentation system - by marwanalramahi - 12.02.2014, 11:40
Re: presentation system - by CuervO - 12.02.2014, 11:57
Re: presentation system - by Slicebook - 12.02.2014, 15:20
Re: presentation system - by ColeMiner - 12.02.2014, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)