Textdraws problemo-- Delay before showing again! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraws problemo-- Delay before showing again! (
/showthread.php?tid=598797)
Textdraws problemo-- Delay before showing again! -
Zens - 16.01.2016
So, for some reason my textdraws only shows every 1 minute. For example I want my textdraws to show once a player goes into a pickup, it disappears 7 seconds after but wont appear untill 1 minute after if you re-enter the pickup.
It shows again on the exact minute change IG.
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
if(PickedUpPickup[playerid] == false)
{
PickedUpPickup[playerid] = true;
LastPickup[playerid] = gettime();
new i;
for(i = 0; i < MAX_BIZ; i++)
{
if(pickupid == Business[i][PickupID])
{
new str[128];
format(str, sizeof(str), "%s", Business[i][Name]);
InformationBox(playerid, str);
return 1;
}
}
for(i = 0; i < MAX_HOUSES; i++)
{
if(pickupid == Houses[i][PickupID])
{
new str[128],propertysale[240];
new id = InRangeOfHouse(playerid);
PropertyBox(playerid);
format(str, sizeof(str), "~g~~h~~h~ %s", Houses[i][Name]);
PropertyName(playerid, str);
if (Houses[id][Owner] == 0) propertysale = "~w~State: ~g~~h~~h~For sale!";
else propertysale = "~w~State: ~r~Not for sale!";
format(str, sizeof(str), "%s", propertysale);
PropertySale(playerid, str);
new query[128];
mysql_format(SQL_CONNECTION, query, sizeof(query), "SELECT `Name` FROM Characters WHERE ID = %d LIMIT 1", Houses[id][Owner]);
mysql_tquery(SQL_CONNECTION, query, "ShowOwner", "i", id);
return 1;
}
}
for(i = 0; i < MAX_COMPANIES; i++)
{
if(pickupid == Companies[i][PickupID])
{
new str[128];
PropertyBox(playerid);
format(str, sizeof(str), "~g~~h~~h~ %s", Companies[i][Name]);
PropertyName(playerid, str);
return 1;
}
}
for(i = 0; i < MAX_ICONS; i++)
{
if(pickupid == Icons[i][PickupID])
{
if(Icons[i][Type] == 1) return InformationBox(playerid, "~p~Regular Vehicle Dealership~n~~w~Please use the command ~y~/buyvehicle ~w~to view the dealership's stock!");
else if(Icons[i][Type] == 2) return InformationBox(playerid, "~p~Supercar Vehicle Dealership~n~~w~Please use the command ~y~/buyvehicle ~w~to view the dealership's stock!");
else if(Icons[i][Type] == 3) return InformationBox(playerid, "~p~Commercial Vehicle Dealership~n~~w~Please use the command ~y~/buyvehicle ~w~to view the dealership's stock!");
else if(Icons[i][Type] == 4) return InformationBox(playerid, "~g~$$ Payday $$~n~~w~If you have a paycheck you can collect it using the command ~y~/payday~w~. Paydays are obtained every hour if you have played an hour prior.");
else if(Icons[i][Type] == 5) return InformationBox(playerid, "~g~Bank~n~~w~To access you bank account do ~y~/balance, /withdraw or /deposit~w~.");
else if(Icons[i][Type] == 6) return InformationBox(playerid, "~g~ATM");
else if(Icons[i][Type] == 7) return InformationBox(playerid, "~y~PayPhone - Use /payphone to use.");
else if(Icons[i][Type] == 9) return InformationBox(playerid, "~p~Scrap Dealer~n~~w~You can sell your vehicle for scrap by using the command ~y~/scrapcar~w~. Please note that this will ~r~DELETE~w~ your vehicle.");
else if(Icons[i][Type] == 10) return InformationBox(playerid, "~r~Garage~n~~w~To spray your vehicle a different color use the command ~y~/spray [1/2] [color id]~w~.");
else if(Icons[i][Type] == 11) return InformationBox(playerid, "~g~Repair Garage~n~~w~To repair your vehicle use the command ~y~/repair~w~.");
else if(Icons[i][Type] == 12) return InformationBox(playerid, "~g~DMV~n~~w~ The driving test cost $1000 to take. To proceed use the command ~y~/dmv~w~.");
else if(Icons[i][Type] == 13) return InformationBox(playerid, "~y~Lockers~n~~w~ To access the locker please use ~y~/locker~w~.");
else if(Icons[i][Type] == 14) return InformationBox(playerid, "~p~Vehicle Modification Center~n~~w~ Mechanics can perform vehicle modifications to personal vehicles here using the command ~y~/vmods~w~.");
else if(Icons[i][Type] == 15) return InformationBox(playerid, "~b~Faction Weapon Cache~n~~w~ Faction weapons can be bought and equipped here using the command ~y~/weaponcache~w~.~n~~r~WARNING~w~:It is against the rules to distribute faction weapons.");
}
}
}
return 1;
}
Basicly focusing mostly on the houses right now.
Re: Textdraws problemo-- Delay before showing again! -
valych - 17.01.2016
I guess your problem occurs due to this part of code:
PHP код:
if(PickedUpPickup[playerid] == false)
{
PickedUpPickup[playerid] = true;
LastPickup[playerid] = gettime();
//.......
Try to find the code in your gamemode, where PickedUpPickup[playerid] = false; and share it with us.