09.08.2015, 22:10
The problem is that you never kill your timer therefor it only works the first time, it's not the problem of the GameText
Also why don't you use an array...
Also why don't you use an array...
pawn Код:
new PickupData[][] = {
{_: 1555.0126, _: -1675.6150, _: 16.1953, "~g~~h~Los Santos~n~Police Station~nPress ENTER to enter"},
{_: -1605.6244, _: 710.8470, _: 13.8672, "~g~~h~San Fierro~n~Police Station~nPress ENTER to enter"},
{_: 1527.3308, _: -1677.8696, _: 5.89060, "~g~~h~Police Armory~n~Type /jail to jail a player"},
{_: -1606.2068, _: 674.6216, _: -5.2422, "~g~~h~Police Armory~n~Type /jail to jail a player"},
{_: 1489.6228, _: 1307.7324, _: 1093.2891, "~g~~h~Faction Safe~n~~y~~h~Type ~l~~b~/opensafe~y~~h~ to open faction safe"},
{_: 1122.7064, _: -2036.9652, _: 69.8943, "~y~~h~La Cosa Nostra Mansion~n~~g~~h~Members Only~n~~g~~h~Press ENTER to enter"},
{_: 1022.5063, _: -1121.4207, _: 23.8701, "~g~~h~Yakuza Dojo~n~~y~~h~Members Only~n~~y~~h~Press ENTER to enter"},
{_: 1568.6696, _: -1689.9703, _: 6.21880, "~b~~h~Parking Elevator~n~~y~~h~Members Only~n~~y~~h~Press ENTER to enter"},
{_: -1594.2114, _: 716.2192, _: -4.9063, "~b~~h~Parking Elevator~n~~y~~h~Members Only~n~~y~~h~Press ENTER to enter"},
{_: 246.4364, _: 87.2288, _: 1003.6406, "~y~~h~Police Station Elevator~n~~g~~h~Members Only~n~~g~~h~Press ENTER to enter"},
{_: 1557.3055, _: -1675.5918, _: 28.3955, "~y~~h~Rooftop Elevator~n~~g~~h~Members Only~n~~g~~h~Press ENTER to enter"},
{_: -2061.7903, _: 464.6996, _: 35.1723, "~y~~h~News Reporters Elevator~n~~g~~h~Members Only~n~~g~~h~Press ENTER to go up"},
{_: -2060.6897, _: 459.2543, _: 139.7422, "~y~~h~News Reporters Elevator~n~~g~~h~Members Only~n~~g~~h~Press ENTER to go down"},
{_: 1293.4641, _: 6.78880, _: 1001.0078, "~y~~h~Training Room Exit~n~~g~~h~Members Only~n~~g~~h~Press ENTER to exit"},
{_: 2315.6211, _: -0.4332, _: 26.7422, "~y~~h~Bank Safe~n~~g~~h~Moneys are deposited here~n~~g~~h~Press ENTER to enter"},
{_: 2147.8979, _: 1603.1907, _: 1006.1677, "~y~~h~Bank Safe~n~~g~~h~Press ENTER to exit"},
{_: 2308.8760, _: -2.4525, _: 26.7422, "~y~~h~Transfer Room~n~~g~~h~Type ~b~/transfer~g~ to transfer money"},
{_: 2312.2046, _: -16.6637, _: 26.7496, "~y~~h~Bank Deposit~n~~g~~h~Type ~b~/withdraw~g~ to empty your savings"},
{_: 2314.8796, _: -16.6626, _: 26.7496, "~y~~h~Bank Deposit~n~~g~~h~Type ~b~/bank~g~ to save your money"}
};
new PickupTimer = -1; // Init with invalid value
public OnPlayerPickUpPickup(playerid, pickupid) {
for(new p; p < sizeof PickupData; ++p) {
if(pickupid == pUPs[p]) {
GameTextForPlayer(playerid, PickupData[p][3], 1000 * 60 * 60 * 24, 4);
KillTimer(PickupTimer);
PickupTimer = SetTimerEx("OnPlayerExitPickup", 1000, true, "ii", playerid, p);
break;
}
}
return true;
}
public OnPlayerExitPickup(playerid, pickupid) {
if(!IsPlayerInRangeOfPoint(playerid, 1.0, Float: PickupData[pickupid][0], Float: PickupData[pickupid][1], Float: PickupData[pickupid][2])) {
GameTextForPlayer(playerid, " ", 0, 4);
KillTimer(PickupTimer);
}
}