CMD:createhouse( playerid, params[ ] ) {
if( PlayerInfo[ playerid ][ pAdmin ] < 6 )
return SendClientMessage( playerid, -1, "Nu esti un administrator level 6+." );
new type[ 15 ], house, inttype, level, price, Float: x, Float: y, Float: z; GetPlayerPos( playerid, x, y, z ); gString[ 0 ] = (EOS);
if( sscanf( params, "s[15]dd", type, level, price ) )
return SendClientMessage( playerid, -1, "{dd0808}Syntax:{ffffff} /createhouse [big | medium | small] [level] [price]" );
if( strmatch( type, "big" ) ) house = random( 3 );
else if( strmatch( type, "medium" ) ) house = random( 3 ) + 3;
else if( strmatch( type, "small" ) ) house = random( 3 ) + 6;
else return SendClientMessage( playerid, -1, "{dd0808}Syntax:{ffffff} /createhouse [big | medium | small] [level] [price]" );
if( house >= 0 && house <= 2 ) inttype = 2;
else if( house >= 3 && house <= 5 ) inttype = 1;
else if( house >= 6 && house <= 8 ) inttype = 0;
SCM( playerid, -1, "Processing..." );
mysql_format( SQL, gString, sizeof gString, "INSERT INTO `houses` (`Entrancex` , `Entrancey` , `Entrancez` , `Exitx` , `Exity` , `Exitz` , `Interior`, `Level` , `Value`) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d') ", x, y, z, houseInterior[ house ][ 0 ], houseInterior[ house ][ 1 ], houseInterior[ house ][ 2 ], houseInteriorID[ house ], level, price );
mysql_tquery( SQL, gString, "insertServerHouse", "dddddffffff", playerid, houseInteriorID[ house ], inttype, level, price, x, y, z, houseInterior[ house ][ 0 ], houseInterior[ house ][ 1 ], houseInterior[ house ][ 2 ] );
return true; }