How can i do this without spam?
#1

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
Reply
#2

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);
        }
Reply
#3

That would stop it from spamming 16 times?
Reply
#4

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;
        }
Reply
#5

yea,it shoul work with break
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)