13.02.2019, 20:33
(
Последний раз редактировалось polygxn; 13.02.2019 в 21:31.
)
My last topic was about that I got 3-4 seconds delay when I clicked on the "Login" textdraw but now its a different case. So the problem is when I click (for example) the Glen Park textdraw I get 1-2 seconds delay before the function executes (so, before the camera pos and look angle changes). Since my english is really bad here is my code, maybe its more clear with it:
Variables:
Select where I want to spawn:
When I click this button (spawn) my character spawns at the selected location:
I just want to make it clear, and Im pretty sure there is an easier way to do these type of stuff so...this is why I post this. Maybe you guys can help me with that.
Variables:
PHP код:
new bool:glenpark;
new bool:idlewood;
new bool:market;
new bool:pigpen;
new bool:rodeo;
PHP код:
hook OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Spawner_Textdraw1)
{
SetPlayerCameraLookAt(playerid, 2061.863037, -1241.968750, 96.064331, 1);
SetPlayerCameraPos(playerid, 2065.282714, -1243.963134, 99.118499);
SetSpawnInfo(playerid, NO_TEAM, pData[playerid][pSkin], 1975.8727, -1196.0349, 25.8565, 92.4579, 0, 0, 0, 0, 0, 0);
glenpark = true;
idlewood = false;
market = false;
pigpen = false;
rodeo = false;
}
if(clickedid == Spawner_Textdraw2)
{
SetPlayerCameraLookAt(playerid, 2112.351318, -1741.657104, 29.260829, 1);
SetPlayerCameraPos(playerid, 2116.203369, -1744.538818, 30.623826);
SetSpawnInfo(playerid, NO_TEAM, pData[playerid][pSkin], 2074.6162, -1698.0490, 13.5547, 272.0087, 0, 0, 0, 0, 0, 0);
glenpark = false;
idlewood = true;
market = false;
pigpen = false;
rodeo = false;
}
if(clickedid == Spawner_Textdraw3)
{
SetPlayerCameraLookAt(playerid, 1098.410278, -1379.536743, 51.293975, 1);
SetPlayerCameraPos(playerid, 1096.113891, -1375.498291, 53.142616);
SetSpawnInfo(playerid, NO_TEAM, pData[playerid][pSkin], 1129.0845, -1490.3561, 22.7690, 0.4082, 0, 0, 0, 0, 0, 0);
glenpark = false;
idlewood = false;
market = true;
pigpen = false;
rodeo = false;
}
if(clickedid == Spawner_Textdraw4)
{
SetPlayerCameraLookAt(playerid, 2436.882568, -1271.516967, 41.213577, 1);
SetPlayerCameraPos(playerid, 2439.441894, -1275.723754, 42.080848);
SetSpawnInfo(playerid, NO_TEAM, pData[playerid][pSkin], 2412.8335, -1244.5699, 23.8125, 179.8994, 0, 0, 0, 0, 0, 0);
glenpark = false;
idlewood = false;
market = false;
pigpen = true;
rodeo = false;
}
if(clickedid == Spawner_Textdraw5)
{
SetPlayerCameraLookAt(playerid, 460.348541, -1562.994262, 57.691375, 1);
SetPlayerCameraPos(playerid, 464.638671, -1564.508300, 59.765613);
SetSpawnInfo(playerid, NO_TEAM, pData[playerid][pSkin], 408.6932, -1543.6320, 32.2734, 225.0360, 0, 0, 0, 0, 0, 0);
glenpark = false;
idlewood = false;
market = false;
pigpen = false;
rodeo = true;
}
}
PHP код:
if(clickedid == Spawner_Textdraw6)
{
if(glenpark == true || idlewood == true || market == true || pigpen == true || rodeo == true)
{
DSpawner_Textdraw(playerid);
CancelSelectTextDraw(playerid);
OnPlayerReady(playerid);
}
}