26.02.2013, 22:03
How can I make it to where it loads the houses and creates the "CreateDynamicPickup(model,1,x,y,z,world,interior) ;" when the gamemode starts?
pawn Код:
public OnGameModeInit(){
houses = db_open("houses.db");
db_query(houses, "CREATE TABLE IF NOT EXISTS `HOUSES` (`MODEL`,`FLOAT:X`,`FLOAT:Y`,`FLOAT:Z`,`WORLD`,`INTERIOR`)");
}
CMD:house(playerid, params[]){
if(Bit16_Get(g_Admin,playerid) == 5) {
new query[256];
new model,Float:x,Float:y,Float:z,world = GetPlayerVirtualWorld(playerid),interior = GetPlayerInterior(playerid);
if(sscanf(params,"ii",model)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /house [ID]");
GetPlayerPos(playerid,x,y,z);
format(query,sizeof(query),"UPDATE `HOUSES` SET MODEL = '%d', FLOAT:X = '%d', FLOAT:Y = '%d', FLOAT:Z = '%d', WORLD = '%d', INTERIOR = '%d'",
model,
x,
y,
z,
world,
interior);
db_query(houses,query);
CreateDynamicPickup(model,1,x,y,z,world,interior);
}
return 1;
}