How can i do this without spam? -
iTorran - 02.12.2010
Hello,
I was wondering how i could display the 4 SCM's without it spamming? And without it showing House Info on other pickups,
pawn Код:
if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
{
SendClientMessage(playerid, COLOR_GREY, "|________________ HOUSING AGENCY ______________|");
format(str, sizeof str, "Address: %s", HouseInfo[J][HouseNames]);
if(HouseInfo[J][Owned] == 1)
{
format(str2, sizeof str2, "Owner: %s", HouseInfo[J][HouseOwner]);
format(str3, sizeof str3, "For sale: {FF0000}No");
}
if(HouseInfo[J][Owned] == 0)
{
format(str2, sizeof str2, "Owner: No-One");
format(str3, sizeof str3, "For sale: {00FF00}Yes");
}
format(str4, sizeof str4, "Cost Price: %i", HouseInfo[J][HouseCost]);
SendClientMessage(playerid, COLOR_ADMIN, str);
SendClientMessage(playerid, COLOR_ADMIN, str2);
SendClientMessage(playerid, COLOR_ADMIN, str3);
SendClientMessage(playerid, COLOR_ADMIN, str4);
}
Thats how it is atm but it spams the SCM, I dont want it to spam and i only want it to show house info on those pickups
And i dont know how, Can any1 help, ta
Re: How can i do this without spam? -
SkizzoTrick - 02.12.2010
pawn Код:
if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
{
SendClientMessage(playerid, COLOR_GREY, "|________________ HOUSING AGENCY ______________|");
format(str, sizeof str, "Address: %s", HouseInfo[J][HouseNames]);
if(HouseInfo[J][Owned] == 1)
{
format(str2, sizeof str2, "Owner: %s", HouseInfo[J][HouseOwner]);
format(str3, sizeof str3, "For sale: {FF0000}No");
SendClientMessage(playerid, COLOR_ADMIN, str);
SendClientMessage(playerid, COLOR_ADMIN, str3);
}
if(HouseInfo[J][Owned] == 0)
{
format(str2, sizeof str2, "Owner: No-One");
format(str3, sizeof str3, "For sale: {00FF00}Yes");
SendClientMessage(playerid, COLOR_ADMIN, str2);
SendClientMessage(playerid, COLOR_ADMIN, str3);
}
format(str4, sizeof str4, "Cost Price: %i", HouseInfo[J][HouseCost]);
SendClientMessage(playerid, COLOR_ADMIN, str4);
}
Re: How can i do this without spam? -
iTorran - 02.12.2010
That would stop it from spamming 16 times?
Re: How can i do this without spam? -
iggy1 - 02.12.2010
Not sure if that'l work but it shouldn't spam i don't think, i just cant see rest of loop so can't tell if thats what you wan't.
pawn Код:
if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
{
SendClientMessage(playerid, COLOR_GREY, "|________________ HOUSING AGENCY ______________|");
format(str, sizeof str, "Address: %s", HouseInfo[J][HouseNames]);
if(HouseInfo[J][Owned] == 1)
{
format(str2, sizeof str2, "Owner: %s", HouseInfo[J][HouseOwner]);
format(str3, sizeof str3, "For sale: {FF0000}No");
SendClientMessage(playerid, COLOR_ADMIN, str);
SendClientMessage(playerid, COLOR_ADMIN, str3);
break;
}
if(HouseInfo[J][Owned] == 0)
{
format(str2, sizeof str2, "Owner: No-One");
format(str3, sizeof str3, "For sale: {00FF00}Yes");
SendClientMessage(playerid, COLOR_ADMIN, str2);
SendClientMessage(playerid, COLOR_ADMIN, str3);
break;
}
format(str4, sizeof str4, "Cost Price: %i", HouseInfo[J][HouseCost]);
SendClientMessage(playerid, COLOR_ADMIN, str4);
break;
}
Re: How can i do this without spam? -
SkizzoTrick - 02.12.2010
yea,it shoul work with break
Angle isent working -
iTorran - 02.12.2010
Ok ty, Well instead of making a new topic il post it here,
Im saving some vehicles to MySQL and well, "ID, Owner, Model, X, Y, Z" works fine,
No query errors or anything, But when it comes to angle it dosent work? Why :S
pawn Код:
new Float:pPOS[4], str[128];
GetPlayerPos(playerid, pPOS[0], pPOS[1], pPOS[2]);
GetPlayerFacingAngle(playerid, pPOS[3]);
#undef DEFAULT_VEHICLE_OWNER
#define DEFAULT_VEHICLE_OWNER VehicleOwner
format(Query, sizeof(Query), "INSERT INTO vehicles (id, owner, model, x, y, z) VALUES (NULL, '%s', %d, %f, %f, %f);",DEFAULT_VEHICLE_OWNER, PVTModelID, pPOS[0], pPOS[1], pPOS[2]);
mysql_query(Query);
This code works perfect.
This one dosent
pawn Код:
new Float:pPOS[4], str[128];
GetPlayerPos(playerid, pPOS[0], pPOS[1], pPOS[2]);
GetPlayerFacingAngle(playerid, pPOS[3]);
#undef DEFAULT_VEHICLE_OWNER
#define DEFAULT_VEHICLE_OWNER VehicleOwner
format(Query, sizeof(Query), "INSERT INTO vehicles (id, owner, model, x, y, z, a) VALUES (NULL, '%s', %d, %f, %f, %f, %f);",DEFAULT_VEHICLE_OWNER, PVTModelID, pPOS[0], pPOS[1], pPOS[2], pPOS[3]);
mysql_query(Query);
Anyone know? Angle is vital and i dont see why X, Y, Z works but A dosent :S