begin real estate listings
This commit is contained in:
parent
549427500c
commit
dff542823a
@ -8,3 +8,4 @@
|
||||
/* ** Includes ** */
|
||||
#include "irresistible\cnr\features\houses\house.pwn"
|
||||
#include "irresistible\cnr\features\houses\furniture.pwn"
|
||||
#include "irresistible\cnr\features\houses\realestate.pwn"
|
||||
|
57
gamemodes/irresistible/cnr/features/houses/realestate.pwn
Normal file
57
gamemodes/irresistible/cnr/features/houses/realestate.pwn
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Irresistible Gaming (c) 2018
|
||||
* Developed by Lorenc Pekaj
|
||||
* Module: cnr\features\home\realestate.pwn
|
||||
* Purpose: home listings for player homes
|
||||
*/
|
||||
|
||||
/* ** Includes ** */
|
||||
#include < YSI\y_hooks >
|
||||
|
||||
/* ** Definitions ** */
|
||||
|
||||
/* ** Variables ** */
|
||||
|
||||
/* ** Hooks ** */
|
||||
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ** Commands ** */
|
||||
CMD:listhome( playerid, params[ ] )
|
||||
{
|
||||
new Float: coins;
|
||||
|
||||
if ( sscanf( params, "df", coins ) )
|
||||
return 0;
|
||||
|
||||
new
|
||||
houseid = p_InHouse[ playerid ];
|
||||
|
||||
if ( ! Iter_Contains( houses, houseid ) )
|
||||
return SendError( playerid, "This home does not exist" );
|
||||
|
||||
if ( ! IsPlayerHomeOwner( playerid, houseid ) )
|
||||
return SendError( playerid, "You are not the owner of this home." );
|
||||
|
||||
mysql_single_query( sprintf( "INSERT INTO HOUSE_LISTINGS (HOUSE_ID, USER_ID, ASK) VALUES (%d, %d, %f)", houseid, GetPlayerAccountID( playerid ), coins ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ** Functions ** */
|
||||
|
||||
/* ** Migrations ** */
|
||||
/*
|
||||
DROP TABLE HOUSE_LISTINGS;
|
||||
CREATE TABLE IF NOT EXISTS HOUSE_LISTINGS (
|
||||
ID int(11),
|
||||
HOUSE_ID int(11),
|
||||
USER_ID int(11),
|
||||
ASK float,
|
||||
SALE_DATE DATETIME default null,
|
||||
PRIMARY KEY (ID),
|
||||
UNIQUE KEY (HOUSE_ID),
|
||||
FOREIGN KEY (HOUSE_ID) REFERENCES HOUSES (ID) ON DELETE CASCADE
|
||||
);
|
||||
*/
|
Loading…
Reference in New Issue
Block a user