22.10.2013, 14:34
Доброе время суток...
Проблема с CheckPoint
Посмотреть проблему можно тут:
[ame]http://www.youtube.com/watch?v=Zkb2Pr4bGLY[/ame]
Как я понимаю проблема с таймером и привязкой CP
Код:
в new:
Дальше на диалоге рандомно выбивает CP
В public OnPlayerEnterDynamicCP(playerid, checkpointid) проверка на CP
Таймеры:
Ну и снова public OnPlayerEnterDynamicCP(playerid, checkpointid)
Вот не могу догнать как исправить...
Проблема с CheckPoint
Посмотреть проблему можно тут:
[ame]http://www.youtube.com/watch?v=Zkb2Pr4bGLY[/ame]
Как я понимаю проблема с таймером и привязкой CP
Код:
в new:
PHP код:
new WoodCP1[MAX_PLAYERS], WoodCP[MAX_PLAYERS];
PHP код:
switch(random(3))
{
case 0: WoodCP[playerid] = CreateDynamicCP(-558.3461,-96.4911,63.7808, 1, 0, 0, playerid, 300);
case 1: WoodCP[playerid] = CreateDynamicCP(-566.5664,-96.6741,64.1709, 1, 0, 0, playerid, 300);
case 2: WoodCP[playerid] = CreateDynamicCP(-575.8914,-97.3578,64.9064, 1, 0, 0, playerid, 300);
}
PHP код:
if(checkpointid == WoodCP[playerid])
{
new JoinsTimer[MAX_PLAYERS];
ApplyAnimation(playerid, "CHAINSAW", "WEAPON_csaw", 4.1, 1, 0, 0, 0, 0);
DestroyDynamicCP(WoodCP[playerid]);
JoinsTimer[playerid] = SetTimerEx("Joins",9800,false,"i",playerid);
}
PHP код:
forward Joins(playerid);
public Joins(playerid)
{
new JoinsTimer[MAX_PLAYERS];
if(WoodJoins[playerid] == true)
{
ApplyAnimation(playerid, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0);
JoinsTimer[playerid] = SetTimerEx("JoinS",1500,false,"i", playerid);
}
return true;
}
forward JoinS(playerid);
public JoinS(playerid)
{
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playerid, 1, 1463, 5, 0.0670, 0.1399, 0.2609, -82.99, -2.09, -70.60, 0.43, 0.29, 0.41);
WoodCP1[playerid] = CreateDynamicCP(-536.3078,-74.1449,62.8594,2,0,0,playerid,300);
return true;
}
PHP код:
if(checkpointid == WoodCP1[playerid])
{
ApplyAnimation(playerid, "CARRY", "PUTDWN", 4.1, 0, 1, 1, 0, 0, 1);
SetPlayerAttachedObject(playerid, 1, 341, 6, 0.0000, 0.0000, 0.0000, 0.00, 0.00, 0.00, 1.00, 1.00, 1.00);
DestroyDynamicCP(WoodCP1[playerid]);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
switch(random(16))
{
case 0: WoodCP[playerid] = CreateDynamicCP(-558.3461,-96.4911,63.7808, 1, 0, 0, playerid, 300);
case 1: WoodCP[playerid] = CreateDynamicCP(-566.5664,-96.6741,64.1709, 1, 0, 0, playerid, 300);
case 2: WoodCP[playerid] = CreateDynamicCP(-575.8914,-97.3578,64.9064, 1, 0, 0, playerid, 300);
}
}