30.07.2016, 04:32
Anyone can help me?
PHP код:
[22:49:51] [debug] Server crashed while executing PuraJoda.amx
[22:49:51] [debug] AMX backtrace:
[22:49:51] [debug] #0 0000007b in ?? (48, 70, 70, 48, 48, 125, 118, 101, 110, 116, ... <2 arguments>) from PuraJoda.amx
[22:49:51] [debug] #1 0000007b in public cmd_addhouse () from PuraJoda.amx
[22:49:51] [debug] #2 native CallLocalFunction () from samp03svr
[22:49:51] [debug] #3 00000748 in public OnPlayerCommandText (1, 9130092) from PuraJoda.amx
PHP код:
CMD:addhouse(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new
string[128],
hid,
price,
level,
interior,
Float:p_Pos[3],
query[500], data[200]
;
if(sscanf(params, "iii", level, price,interior)) return SendClientMessage(playerid, COLOR_YELLOW, "USA: /addhouse <(Premium)level> <precio> <interiorid(0-17)>");
if(interior < 0 || interior > 20) return SendClientMessage(playerid, COLOR_RED, "[Pura Joda] No exceda lнmite de interiores.");
if(level < 0) return SendClientMessage(playerid, COLOR_RED, "[Pura Joda] Nivel despuйs de 0");
new DBResult:y = db_query(HouseDB, "SELECT hWorld FROM `pjHouse` ORDER BY `hWorld` desc LIMIT 1");
new field2[30],world; db_get_field_assoc(y, "hWorld", field2, 30); world = strval(field2);
db_free_result(y);
world++;
GetPlayerPos(playerid, p_Pos[0], p_Pos[1], p_Pos[2]);
strcat(query, "INSERT INTO `pjHouse` (`hName`, `hOwner`, `hIntName`, `hNotes`,`hLevel`, `hPrice`, `hSale`, `hInt`, `hWorld`, `hLock`, `hPx`, `hPy`, `hPz`, `hPa`, `hEx`, `hEy`, `hEz`, `hEXx`, `hEXy`, `hEXz`, `hMSafe`) VALUES (");
format(data, sizeof(data), "'None','None','%s','None','%d','%d','0','%d',",intInfo[interior][Name],level,price,intInfo[interior][i_Int]);
strcat(query, data);
format(data, sizeof(data), "'%d','1','%f','%f','%f',",world,intInfo[interior][SpawnPointX],intInfo[interior][SpawnPointY],intInfo[interior][SpawnPointZ]);
strcat(query, data);
format(data, sizeof(data), "'%f','%f','%f','%f','%f','%f','%f','1')",intInfo[interior][SpawnPointA],p_Pos[0],p_Pos[1],p_Pos[2],intInfo[interior][ExitPointX],intInfo[interior][ExitPointY],intInfo[interior][ExitPointZ]);
strcat(query, data);
db_free_result(db_query(HouseDB, query));
new DBResult:r = db_query(HouseDB, "SELECT `hID` FROM `pjHouse` ORDER BY `hID` desc LIMIT 1"); new field[30]; db_get_field_assoc(r, "hID", field, 30); hid = strval(field); db_free_result(r);
format(hInfo[hid][hName], 256, "None");
format(hInfo[hid][hOwner], 256, "None");
hInfo[hid][hLevel] = level;
hInfo[hid][hPrice] = price;
hInfo[hid][hSale] = 0;
hInfo[hid][hInterior] = intInfo[interior][i_Int];
hInfo[hid][hWorld] = world;
hInfo[hid][hLocked] = 1;
hInfo[hid][hEnterPos][0] = intInfo[interior][SpawnPointX];
hInfo[hid][hEnterPos][1] = intInfo[interior][SpawnPointY];
hInfo[hid][hEnterPos][2] = intInfo[interior][SpawnPointZ];
hInfo[hid][hEnterPos][3] = intInfo[interior][SpawnPointA];
hInfo[hid][hPickupP][0] = p_Pos[0];
hInfo[hid][hPickupP][1] = p_Pos[1];
hInfo[hid][hPickupP][2] = p_Pos[2];
hInfo[hid][ExitCPPos][0] = intInfo[interior][ExitPointX];
hInfo[hid][ExitCPPos][1] = intInfo[interior][ExitPointY];
hInfo[hid][ExitCPPos][2] = intInfo[interior][ExitPointZ];
format(hInfo[hid][hIName], 256, "%s", intInfo[interior][Name]);
format(hInfo[hid][hNotes], 256, "None");
hInfo[hid][MoneyStore] = 0;
format(string, sizeof(string), "[Pura Joda] HouseID %d creada. PJCoins necesarias %d, Nivel Premium %d, Mundo virtual %d",hid ,price, level, world);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "[Pura Joda] Casa creada bajo el interior %s (Int %d)", intInfo[interior][Name], interior);
SendClientMessage(playerid, -1, string);
if(hInfo[hid][hSale] == 0)
{
format(string, 256, ""W"Direcciуn: "G"%d\n"W"Interior: "G"%s\n"W"Precio: "G"%d PJCoin(s).\n\n"W"Propiedad en "G"venta.", hid, hInfo[hid][hIName], hInfo[hid][hPrice]);
if(hInfo[hid][hLevel] >= 4)
{
hInfo[hid][hMapIcon] = CreateDynamicMapIcon(hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], SALE_ICON, -1, 0, 0, -1, STREAM_DISTANCES, MAPICON_LOCAL);
hInfo[hid][hPickup] = CreateDynamicPickup(19524, 1, hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], 0, 0, -1, STREAM_DISTANCES2);
}
else
if(hInfo[hid][hLevel] == 3)
{
hInfo[hid][hMapIcon] = CreateDynamicMapIcon(hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], SALE_ICON, -1, 0, 0, -1, STREAM_DISTANCES, MAPICON_LOCAL);
hInfo[hid][hPickup] = CreateDynamicPickup(19523, 1, hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], 0, 0, -1, STREAM_DISTANCES2);
}
else
{
hInfo[hid][hMapIcon] = CreateDynamicMapIcon(hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], SALE_ICON, -1, 0, 0, -1, STREAM_DISTANCES, MAPICON_LOCAL);
hInfo[hid][hPickup] = CreateDynamicPickup(SALE_PICKUP, 1, hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], 0, 0, -1, STREAM_DISTANCES2);
}
}
else
{
if(hInfo[hid][hLocked] == 0)
{
if(strcmp(hInfo[hid][hName], "None", true) == 0)
{
format(string, 256, ""W"Direcciуn: "R"%d\n"W"Propietario: "R"%s\n\n"R"Presiona 'Y' para entrar.", hid, hInfo[hid][hOwner]);
}
else
{
format(string, 256, ""W"Direcciуn: "R"%d\n"W"Propietario: "R"%s\n\n"R"Presiona 'Y' para entrar.", hid, hInfo[hid][hOwner]);
}
}
else
{
if(strcmp(hInfo[hid][hName], "None", true) == 0)
{
format(string, 256, ""W"Direcciуn: "R"%d\n"W"Propietario: "R"%s\n\n"R"Presiona 'Y' para entrar.", hid, hInfo[hid][hOwner]);
}
else
{
format(string, 256, ""W"Direcciуn: "R"%d\n"W"Propietario: "R"%s\n\n"R"Presiona 'Y' para entrar.", hid, hInfo[hid][hOwner]);
}
}
hInfo[hid][hMapIcon] = CreateDynamicMapIcon(hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], NOTSALE_ICON, -1, 0, 0, -1, STREAM_DISTANCES, MAPICON_LOCAL);
hInfo[hid][hPickup] = CreateDynamicPickup(19522, 1, hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], 0, 0, -1, STREAM_DISTANCES2);
}
hInfo[hid][hLabel] = CreateDynamic3DTextLabel(string, -1, hInfo[hid][hPickupP][0], hInfo[hid][hPickupP][1], hInfo[hid][hPickupP][2], STREAM_DISTANCES3, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, 0, -1, STREAM_DISTANCES3);
hInfo[hid][hCP] = CreateDynamicCP(hInfo[hid][ExitCPPos][0], hInfo[hid][ExitCPPos][1], hInfo[hid][ExitCPPos][2], 2.0, hInfo[hid][hWorld], hInfo[hid][hInterior], -1, 15.0);
format(string, sizeof(string), "CASA ID [%d] creada.",hid);
SendClientMessage(playerid,-1, string);
printf("...HouseID %d created", hid);
SaveHouse(hid);
DestroyDynamicCP(hInfo[hid][hCP]);
DestroyDynamicPickup(hInfo[hid][hPickup]);
DestroyDynamicMapIcon(hInfo[hid][hMapIcon]);
DestroyDynamic3DTextLabel(hInfo[hid][hLabel]);
LoadHouse(hid);
return 1;
}