Timer is not stopping
#1

Removed, Thanks
Reply
#2

pawn Код:
CMD:stop(playerid,params[])
{
    SpawnPlayer(playerid);
    KillTimer(camera1);
    KillTimer(camera2);
    KillTimer(camera3);
    KillTimer(camera4);
    KillTimer(camera5);
    return 1;
}
Reply
#3

You have to assign each timer to a variable, or:
pawn Код:
new CameraTimers[4];
pawn Код:
forward camera1(playerid);
public camera1(playerid)
{
    for(new i = 0; i < 11; i++) SendClientMessage(playerid,green," ");
    SetPlayerCameraPos(playerid,-1570.6459,1245.7227,114.2623);
    SetPlayerCameraLookAt(playerid, -1560.6459,1236.7227,114.2217);
    CameraTimers[0] = SetTimerEx("camera2", 8000, false, "d", playerid);
    return 1;}
forward camera2(playerid);
public camera2(playerid)
{
    for(new i = 0; i < 11; i++) SendClientMessage(playerid,green," ");
    SetPlayerCameraPos(playerid,-1570.6459,1245.7227,114.2623);
    SetPlayerCameraLookAt(playerid, -1560.6459,1236.7227,114.2217);
    CameraTimers[1] = SetTimerEx("camera3", 8000, false, "d", playerid);
    return 1;}
forward camera3(playerid);
public camera3(playerid)
{
    for(new i = 0; i < 11; i++) SendClientMessage(playerid,green," ");
    SetPlayerCameraPos(playerid,-1570.6459,1245.7227,114.2623);
    SetPlayerCameraLookAt(playerid, -1560.6459,1236.7227,114.2217);
    CameraTimers[2] = SetTimerEx("camera4", 8000, false, "d", playerid);
    return 1;}
forward camera4(playerid);
public camera4(playerid)
{
    for(new i = 0; i < 11; i++) SendClientMessage(playerid,green," ");
    SetPlayerCameraPos(playerid,-1570.6459,1245.7227,114.2623);
    SetPlayerCameraLookAt(playerid, -1560.6459,1236.7227,114.2217);
    CameraTimers[3] = SetTimerEx("camera5", 8000, false, "d", playerid);
    return 1;}
forward camera5(playerid);
public camera5(playerid)
{
    for(new i = 0; i < 11; i++) SendClientMessage(playerid,green," ");
    SpawnPlayer(playerid);
    return 1;}
pawn Код:
CMD:stop(playerid,params[])
{
    SpawnPlayer(playerid);
    KillTimer(CameraTimers[0]);
    KillTimer(CameraTimers[1]);
    KillTimer(CameraTimers[2]);
    KillTimer(CameraTimers[3]);
    return 1;
}
Reply
#4

is it me or why is their always the same code in each camera function ...

also you only need one timer variable since the other timer wont repeat
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)