The txtdraw doesnt disappear - Riddy - 03.07.2012
pawn Код:
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(PlayerToPoint(2.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "~b~SHOP:~w~%s~b~~n~OWNER:~w~%s~n~~b~VALUE:~w~ $%d",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bEntranceCost]);
}
else
{
format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~~b~ /buybiz ~w~to buy this Business",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
}
InfoBoxForPlayer(i, string);
SendDebugMessage("CustomPickups, BizzInfo");
}
}
for(new h = 0; h < sizeof(IntInfo); h++)
{
if(PlayerToPoint(2.0, i, IntInfo[h][iEntrancex], IntInfo[h][iEntrancey], IntInfo[h][iEntrancez]))
{
format(string, sizeof(string), "~r~%s~n~~w~TYPE~b~ /enter TO GO INSIDE",IntInfo[h][iDiscription]);
InfoBoxForPlayer(i, string);
SendDebugMessage("CustomPickups, IntInfo");
}
}
for(new h = 0; h < sizeof(FamilyInfo); h++)
{
if(PlayerToPoint(2.0, i, FamilyInfo[h][FamilySpawn][0],FamilyInfo[h][FamilySpawn][1],FamilyInfo[h][FamilySpawn][2]))
{
if(PlayerInfo[i][pMember] != h && FamilyInfo[h][FamilyLocked] == 1)
{
InfoBoxForPlayer(i, "~r~Locked!");
}
else
{
format(string, sizeof(string), "~y~Faction: %s~n~~w~TYPE~b~ /enter TO GO INSIDE", FamilyInfo[h][FamilyName]);
InfoBoxForPlayer(i, string);
SendDebugMessage("CustomPickups, FamilyInfo");
}
}
}
for(new h = 0; h < sizeof(ATMs); h++)
{
if(PlayerToPoint(2.0, i, ATMs[h][0], ATMs[h][1], ATMs[h][2]))
{
InfoBoxForPlayer(i, "~b~/CARD~w~TO ACCESS THE ATM");
}
}
for(new h = 0; h < sizeof(Dealerships); h++)
{
if(PlayerToPoint(2.0, i, Dealerships[h][0], Dealerships[h][1], Dealerships[h][2]))
{
InfoBoxForPlayer(i, "~b~Business:~w~Dealership~n~~y~/V BUY TO ACCESS THE VEHICLES");
}
}
}
if (IsAtPGarbage(i))
{
GameTextForPlayer(i, "~w~ Pick Garbage ~n~~r~ Press C", 5000, 3);
return 1;
}
if (IsAtPPhone(i))
{
InfoBoxForPlayer(i, "~y~PHONE BOOTH~n~~b~/USEPHONE");
return 1;
}
if (PlayerToPoint(5.0, i,3637.2280,-999.4510,156.8103))
{
InfoBoxForPlayer(i, "~p~BEERSTORE~n~~y~TYPE /buydrink");
return 1;
}
if (PlayerToPoint(5.0, i,299.9413,-1608.5790,33.0807))
{
InfoBoxForPlayer(i, "~p~Business:~y~Hotel~n~~b~OWNER:~w~BANK~n~TO ENTER TYPE /ENTER");
return 1;
}
if (PlayerToPoint(5.0, i,1498.2429,-1582.1270,13.5498))
{
InfoBoxForPlayer(i, "~p~Business:~y~APARTMENT COMPLEX~n~~b~OWNER:~w~BANK~n~TO ENTER TYPE /ENTER");
return 1;
}
if (PlayerToPoint(5.0, i,1753.5541,-1893.8787,13.5571))
{
InfoBoxForPlayer(i, "~p~Business:~y~APARTMENT COMPLEX~n~~b~OWNER:~w~BANK~n~TO ENTER TYPE /ENTER");
return 1;
}
if (PlayerToPoint(5.0, i,1105.9545,-301.9370,74.5391))
{
GameTextForPlayer(i, "~w~Drug Seeds~n~~r~/buyseeds", 5000, 3);
return 1;
}
if (PlayerToPoint(5.0, i,361.8300,173.2659,1008.3828))
{
InfoBoxForPlayer(i, "~p~Business:~y~AGENCY~n~~b~OWNER:~w~BANK~n~TO ACCESS TYPE /SECURE");
return 1;
}
if (PlayerToPoint(5.0, i,2309.9124,32.3308,-41.4836))
{
InfoBoxForPlayer(i, "~b~Business:~w~BANK~n~~b~OWNER:~w~BANK~n~TO ACCESS TYPE /BUYVAULT,THEN /VAULT");
return 1;
}
for(new h = 0; h < sizeof(Jobs); h++)
{
if(PlayerToPoint(2.0, i, Jobs[h][0], Jobs[h][1], Jobs[h][2]))
{
format(string, sizeof(string), "~b~TYPE:~w~JOB~n~~b~INFO:~w~%s", JobNames[h]);
InfoBoxForPlayer(i, string);
SendDebugMessage("CustomPickups, Jobs");
}
}
This is under a made public header...
pawn Код:
stock InfoBoxForPlayer(playerid, text[])
{
TextDrawHideForPlayer(playerid, InfoBox[playerid]);
// TextDrawDestroy(InfoBox[playerid]);
new string[800];
//ViewingBox[playerid] = 1;
format(string, sizeof(string), "%s", text);
TextDrawSetString(InfoBox[playerid], string);
TextDrawShowForPlayer(playerid, InfoBox[playerid]);
}
It use to disappear, just stopped working
Re: The txtdraw doesnt disappear -
iggy1 - 03.07.2012
It doesn't disappear because you show it again in that func.
pawn Код:
stock InfoBoxForPlayer(playerid, text[])
{
TextDrawHideForPlayer(playerid, InfoBox[playerid]);
// TextDrawDestroy(InfoBox[playerid]);
new string[800];
//ViewingBox[playerid] = 1;
format(string, sizeof(string), "%s", text);
TextDrawSetString(InfoBox[playerid], string);
TextDrawShowForPlayer(playerid, InfoBox[playerid]);//showing it again
}
Ignore this^^ got wrong end of the stick.
I can't see you destroying/hiding the etxtdraw anywhere in the code you posted apart from that function.
Respuesta: The txtdraw doesnt disappear -
[DOG]irinel1996 - 03.07.2012
You mean it was disappearing after some time automatically, but now doesn't work?
pawn Код:
new HideTimer[MAX_PLAYERS];
stock InfoBoxForPlayer(playerid, text[])
{
TextDrawHideForPlayer(playerid, InfoBox[playerid]);
new string[800];
format(string, sizeof(string), "%s", text);
TextDrawSetString(InfoBox[playerid], string);
TextDrawShowForPlayer(playerid, InfoBox[playerid]); //You can't hide it with this function because you show it again here.
KillTimer(HideTimer[playerid]);
HideTimer[playerid] = SetTimerEx("HideNow",8000,false,"i",playerid);
}
forward HideNow(playerid);
public HideNow(playerid) { TextDrawHideForPlayer(playerid, InfoBox[playerid]); return 1; }
Maybe you had in your script an
else that was hiding the TextDraw (where you are checking the positions) and you deleted it.
Re: The txtdraw doesnt disappear - Riddy - 03.07.2012
pawn Код:
public SetPlayerRandomSpawn(playerid,type)
{
new rand;
new playername[32];
new house = PlayerInfo[playerid][pHousekey];
new complex = PlayerInfo[playerid][pComplexkey];
//SetPlayerWeapons(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,999);
SetPlayerFightingStyle(playerid,PlayerInfo[playerid][pFightSkill]);
if(PlayerInfo[playerid][pTut] == 0) {
SetPlayerScore(playerid,1);
PlayerInfo[playerid][pLevel] = 1;
SetPlayerPos(playerid, 215.7280,1821.2645,6.4141);
TogglePlayerControllable(playerid, 0);
AdminDuty[playerid] = 1;
PlayerInfo[playerid][pAdmin] = 0;
ShowPlayerDialog(playerid, REGISTRATION1,DIALOG_STYLE_MSGBOX,"Government(U.S. Registration) - Account Sex Management","Please specify your sex","Male","Female");
}
else if(PlayerInfo[playerid][pJailed] == 1) {
SetPlayerInterior(playerid, 10);
SetPlayerVirtualWorld(playerid,20);
DOO_SetPlayerPos(playerid,227.2460,109.7719,999.0156);
if(!PlayerInfo[playerid][pWakeMsgSend]) {
SendClientMessage(playerid, COLOR_PURPLE, "** You wake up in Jail **");
PlayerInfo[playerid][pWakeMsgSend]=1;
}
SetPlayerToTeamColor(playerid);
return 1;
}
else if(PlayerInfo[playerid][pJailed] == 2) {
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 1);
PlayerInfo[playerid][pInt] = 0;
DOO_SetPlayerPos(playerid,3523.9175,-503.7138,270.5802);
TogglePlayerControllable(playerid, 0);
Mute[playerid] = 1;
if(!PlayerInfo[playerid][pWakeMsgSend]) {
SendClientMessage(playerid, COLOR_LIGHTRED, " Incomplete Admin-Jail sentence");
PlayerInfo[playerid][pWakeMsgSend]=1;
}
SetPlayerToTeamColor(playerid);
return 1;
}
else if(PlayerInfo[playerid][pJailed] == 3) {
if(!PlayerInfo[playerid][pWakeMsgSend]) {
SendClientMessage(playerid, COLOR_PURPLE, "** You wake up in Prison **");
}
new string[128];
new sendername[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
rand = random(sizeof(gPrisonSpawns));
Pause(playerid); // Warp the player
DOO_SetPlayerPos(playerid, gPrisonSpawns[rand][0],gPrisonSpawns[rand][1], gPrisonSpawns[rand][2]);
SetPlayerFacingAngle(playerid,90);
format(string, sizeof(string), "* %s wakes up in his prison sell and looks around. ",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "* %s sighs. ",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
IntEntered[playerid] = 0;
//SetPlayerFacingAngle(playerid, 90);
return 1;
}
else if(Hospitalized[playerid] == 1) {
SetPlayerToTeamColor(playerid);
TogglePlayerControllable(playerid,false);
SetPlayerHealthExs(playerid,1.0);
DOO_SetPlayerPos(playerid, -3451.3801,475.9214,58.0620);
TogglePlayerControllable(playerid, 0);
new RandomWeth;
RandomWeth = random(2);
switch(RandomWeth) {
case 0:
{
SetPlayerVirtualWorld(playerid,1);
}
case 1:
{
SetPlayerVirtualWorld(playerid,2);
}
}
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~You need to rest now, please wait",8000,3);
SetTimerEx("AfterSpawnHos", 10000, false, "i", playerid);
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
return 1;
}
else if(PlayerInfo[playerid][pCrashed] >= 1 && PlayerInfo[playerid][pCrashed] <= 2) {
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
DOO_SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pWorld]);
if(PlayerInfo[playerid][pCrashHealth] > 5.0) {
SetPlayerHealthExs(playerid,PlayerInfo[playerid][pCrashHealth]);
}
else {
SetPlayerHealthExs(playerid,5.0);
}
SetPlayerArmourExs(playerid,PlayerInfo[playerid][pCrashArmour]);
SetTimerEx("UnsetCrash", 20000, false, "i", playerid);
return 1;
}
else if(PlayerInfo[playerid][pCrashed] > 2) {
PlayerInfo[playerid][pCrashed] = 0;
}
else if(house != 255) {
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,HouseInfo[house][hInt]);
SetPlayerVirtualWorld(playerid,house+100);
DOO_SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
PlayerInfo[playerid][pLocal] = house;
PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
HouseEntered[playerid] = house;
}
else if(complex != 255) {
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,MotelInfo[complex][mInt]);
SetPlayerVirtualWorld(playerid,complex+100);
// Warp the player
DOO_SetPlayerPos(playerid, MotelInfo[complex][mExitx], MotelInfo[complex][mExity],MotelInfo[complex][mExitz]);
PlayerInfo[playerid][pLocal] = complex;
PlayerInfo[playerid][pInt] = MotelInfo[complex][mInt];
MotelEntered[playerid] = complex;
return 1;
}
//PoliceForce spawn
else if (PlayerInfo[playerid][pMember] == 1) {
SetPlayerToTeamColor(playerid);
rand = random(sizeof(gCopPlayerSpawns));
// Warp the player
DOO_SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
//FBI spawn
else if (PlayerInfo[playerid][pMember] == 2) {
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, 299.7097,183.1322,1007.1719);
SetPlayerFacingAngle(playerid, 90);
SetPlayerVirtualWorld(playerid,1);
PlayerInfo[playerid][pInt] = 3;
IntEntered[playerid] = 14;
return 1;
}
else if(PlayerInfo[playerid][pMember] == 3) { //Mayor/Gov spawn
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 3);
DOO_SetPlayerPos(playerid, 356.2998,151.9914,1025.7891);
PlayerInfo[playerid][pInt] = 3;
IntEntered[playerid] = 5;
return 1;
}
else if(PlayerInfo[playerid][pMember] == 14) { //Sheriff Department
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 5);
DOO_SetPlayerPos(playerid, 322.72,306.4,999.11);
PlayerInfo[playerid][pInt] = 5;
IntEntered[playerid] = 5;
return 1;
}
//Fire/Ambulance spawn
else if (PlayerInfo[playerid][pMember] == 4) {
SetPlayerToTeamColor(playerid);
DOO_SetPlayerPos(playerid, -3429.0164,475.4126,57.6132);
SetPlayerFacingAngle(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 2);
IntEntered[playerid] = 2;
return 1;
}
//SAN News
else if (PlayerInfo[playerid][pMember] == 5) {
SetPlayerToTeamColor(playerid);
DOO_SetPlayerPos(playerid, 359.1299,211.8583,1008.3828);
SetPlayerFacingAngle(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 2);
IntEntered[playerid] = 2;
return 1;
}
// Taxi HQ
else if (PlayerInfo[playerid][pMember] == 7) {
SetPlayerToTeamColor(playerid);
DOO_SetPlayerPos(playerid, 2481.2283,-1538.6738,24.1845);
SetPlayerFacingAngle(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid, 2);
IntEntered[playerid] = 2;
return 1;
}
// Factions
else if (PlayerInfo[playerid][pMember] >= 7 && FamilyInfo[PlayerInfo[playerid][pMember]][FamilyInterior] != 0) {
new fam = PlayerInfo[playerid][pMember];
SetPlayerToTeamColor(playerid);
SetPlayerVirtualWorld(playerid,fam);
// Crackden
if(FamilyInfo[fam][FamilyInterior] == 1) {
SetPlayerInterior(playerid,5);
DOO_SetPlayerPos(playerid, 309.9930,1122.5713,1083.8828);
}
// Ryders House
else if(FamilyInfo[fam][FamilyInterior] == 2) {
SetPlayerInterior(playerid,2);
DOO_SetPlayerPos(playerid, 2465.8018,-1698.3330,1013.5078);
}
// CJs house
else if(FamilyInfo[fam][FamilyInterior] == 3) {
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, 2496.0498,-1694.3333,1014.7422);
}
// Maddogs mansion
else if(FamilyInfo[fam][FamilyInterior] == 4) {
SetPlayerInterior(playerid,5);
DOO_SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250);
}
// Tiger skin brothel
else if(FamilyInfo[fam][FamilyInterior] == 5) {
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, 964.106994,-53.205497,1001.124572);
} // Pleasure dome
else if(FamilyInfo[fam][FamilyInterior] == 6) {
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, -2640.762939,1406.682006, 906.460937);
} // Gang House
else if(FamilyInfo[fam][FamilyInterior] == 7) {
SetPlayerInterior(playerid,5);
DOO_SetPlayerPos(playerid, 2350.339843,-1181.649902,1027.976562);
} // Colonel Furhberger's
else if(FamilyInfo[fam][FamilyInterior] == 8) {
SetPlayerInterior(playerid,8);
DOO_SetPlayerPos(playerid, 2807.619873,-1171.899902,1025.570312);
} // Unused Safe House
else if(FamilyInfo[fam][FamilyInterior] == 9) {
SetPlayerInterior(playerid,12);
DOO_SetPlayerPos(playerid, 2324.419921,-1145.568359, 1050.710083);
} // LS Atruim
else if(FamilyInfo[fam][FamilyInterior] == 10) {
SetPlayerInterior(playerid,18);
DOO_SetPlayerPos(playerid, 1710.433715,-1669.379272, 20.225049);
}
return 1;
}
else { // Nooby Spawn
SetPlayerToTeamColor(playerid);
DOO_SetPlayerPos(playerid,1642.2334,-2240.4983,13.4952);
SetPlayerVirtualWorld(playerid,0);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
printf("Spawned at Nooby Spawn");
return 1;
}
printf("Spawned player");
return 1;
}
The last part doesnt work, basically after changing to MySQL, this stopped working, I know has it doesnt show Spawned Player and Spawned at oob spawn
Re: The txtdraw doesnt disappear - Riddy - 03.07.2012
Sorry for double post, but Spawned player works not Spawned at nooby spawn failed
Re: The txtdraw doesnt disappear -
fadhilkab - 03.07.2012
Use GameTextshowForplayer! It makes the textdraw Hide
Re: The txtdraw doesnt disappear - Riddy - 03.07.2012
GameTextShowForPlayer is shit when it comes to this.