01.09.2016, 18:04
title
So the "interior part" doesn't work.
The thing inside the switch don't get called at all.
Even if it's not 1,2 (so default), even default doesn't get called
PHP код:
COMMAND:ahouse(playerid,params[])
{
if(!Player[playerid][Authed] || Player[playerid][Admin] < 4) return SendClientError(playerid, "You are not authorised to use this command.");
new Params[3][20], Params3[120], query[400],string[200],zone[100];
if(sscanf(params, "s[120]", string)) return SendClientUsage(playerid, "/ahouse [ Create / Interior ]");
sscanf(string, "s[20]s[20]s[120]", Params[0], Params[1],Params3);
if(!strcmp(Params[0], "create", true))
{
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid,px,py,pz);
GetZone(px,py,pz,zone);
format(query,sizeof(query),"INSERT INTO houses (hOwner,hLocation,hX,hY,hZ) VALUES ('%s','%s','%f','%f','%f')",Name(playerid),zone,px,py,pz);
mysql_tquery(connection,query,"CreateHouse","i",playerid);
}
if(!strcmp(Params[0], "interior", true))
{
new houseid = strval(Params[1]);
new intid = strval(Params3);
if(!houseid) return SendClientUsage(playerid, "/ahouse [HouseID] [InteriorID]");
if(!intid) return SendClientUsage(playerid, "/ahouse [HouseID] [InteriorID]");
new query3[200];
switch(intid)
{
case 1:
{
House[houseid][hIntX] = 140.17;
House[houseid][hIntY] = 1366.07;
House[houseid][hIntZ] = 1083.65;
House[houseid][hInterior] = 5;
format(query3,sizeof(query3),"UPDATE houses SET hIntX='%i'AND hIntY='%i' AND hIntZ='%i' AND hInterior'%i' WHERE id ='%i'",House[houseid][hIntX],House[houseid][hIntY],House[houseid][hIntZ],House[houseid][hInterior],houseid);
mysql_tquery(connection,query3,"");
}
case 2:
{
House[houseid][hIntX] = 2324.53;
House[houseid][hIntY] = -1149.54;
House[houseid][hIntZ] = 1050.71;
House[houseid][hInterior] = 12;
format(query3,sizeof(query3),"UPDATE houses SET hIntX='%i'AND hIntY='%i' AND hIntZ='%i' AND hInterior'%i' WHERE id ='%i'",House[houseid][hIntX],House[houseid][hIntY],House[houseid][hIntZ],House[houseid][hInterior],houseid);
mysql_tquery(connection,query3,"");
}
default:
{
SendStaffMessage(playerid,"This interior ID is not in use yet.");
return 1;
}
}
}
SendStaffMessage(playerid,"This houses interior has been updated.");
return 1;
}
The thing inside the switch don't get called at all.
Even if it's not 1,2 (so default), even default doesn't get called