Repeating Timer [ REP ++ ]
#1

Hi All. I need help with repeating timer. I have timer for Login but now when player death again show me a Login dialog why ? Codes:

pawn Код:
OnPlayerConnect:

logintimer = SetTimerEx("TimerZaLogin", 7000, false, "i", playerid); // LOGIN TIMER
pawn Код:
public OnPlayerRequestClass(playerid)
{
//-----------------
    PlayerPlaySound(playerid, 1067, 0.0, 0.0, 0.0);
    TogglePlayerSpectating(playerid, 1);
    new RandomStart;
    RandomStart = random(2);
    switch(RandomStart)
    {
        case 0:
        {
            InterpolateCameraPos(playerid, 1167.263549, -953.536621, 44.003799, 1238.583618, -933.317016, 41.953529, 10000, 1);
            InterpolateCameraLookAt(playerid, 1168.216918, -953.339111, 43.775718, 1242.507446, -932.542785, 41.891162, 10000, 1);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1134.3859,-910.9868,62.9894);
        }
        case 1:
        {
            InterpolateCameraPos(playerid, 1291.788452, -807.976135, 88.962501, 1248.348632, -804.083923, 98.385025, 10000, 1);
            InterpolateCameraLookAt(playerid, 1291.308471, -808.819519, 89.203948, 1244.513427, -803.718261, 99.460784, 10000, 1);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1134.3859,-910.9868,62.9894);
        }
    }
}
pawn Код:
forward TimerZaLogin(playerid, classid);
public TimerZaLogin(playerid, classid)
{
//-----------------
    if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
    {
        if(gPlayerAccount[playerid] != 0)
        {
            new loginstring[800];
            new loginname[64];
            GetPlayerName(playerid,loginname,sizeof(loginname));
            format(loginstring, sizeof(loginstring), "{FFFFFF}Dobrodojdovte Gospodine %s\n{0080FF}>{FFFFFF}Vasiot akaunt e registriran i e uspesno vcitan zatoa ve molime\nvnesete ja vasata lozinka za da se logirate na vasiot akaunt\n\n", loginname);
            strcat(loginstring, "{0080FF}>{FFFFFF}Otkako ke se logirate ne zaboravajte na RP Pravilata\nkoj treba da gi pocituvate vo sprotivno ke sleduvaat\nkazni od Admin/GM timot sto e nadlezen zatoa\n\n");
            strcat(loginstring, "{0080FF}>{FFFFFF}DreamCast Gaming vi posakuva mnogu zabava i druzenje\n");
            strcat(loginstring, "{0080FF}>{FFFFFF}Dokolku imate nekoj problem posetete {FFFF00}www.dc-game.tk");
            ShowPlayerDialog(playerid, 12346,DIALOG_STYLE_PASSWORD,"{FF4242}Logiranje",loginstring,"Ok","Izlez");
        }
        else
        {
            new regstring[800];
            format(regstring, sizeof(regstring), "{FFFFFF}Dobrodojdovte na DreamCast RPG Macedonia\n{0080FF}>{FFFFFF}Pred da zapocnete so igranje potrebno e da go registrirate vasiot akaunt.\n\n");
            strcat(regstring, "{0080FF}>{FFFFFF}Za uspesna registracija ke treba da odgovorite na prasanjata koj ke vi bidat postaveni i se vo vrska so Role Play\npravilata koj treba da gi pocituvate pri igranje");
            strcat(regstring, "{FFFFFF}za taa cel uspesno sledete go tutorialot koj ke vi bide prikazan");
            strcat(regstring, "\n\n{0080FF}>{FFFFFF}DreamCast Gaming vi posakuva mnogu zabava i druzenje\n{0080FF}>{FFFFFF}Dokolku imate nekoj problem posetete {FFFF00}www.dc-game.tk");
            ShowPlayerDialog(playerid, DIALOG_REGISTRACIJA1, DIALOG_STYLE_MSGBOX, "{FF4242}Registracija",regstring,"Ok","Izlez");
        }
        PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
        PlayerInfo[playerid][pModel] = Peds[classid][0];
        SetPlayerTeamFromClass(playerid,classid);
        KillTimer(logintimer);
    }
    else SpawnPlayer(playerid); { KillTimer(logintimer); }
    return false;
}
Help me please :/ !! Rep ++
Reply
#2

Show when death or when spawn?
Reply
#3

OnPlayerSpawn

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!gPlayerAnimLibsPreloaded[playerid])
    {
        PreloadAnimLib(playerid,"BOMBER");
        PreloadAnimLib(playerid,"RAPPING");
        PreloadAnimLib(playerid,"SHOP");
        PreloadAnimLib(playerid,"BEACH");
        PreloadAnimLib(playerid,"SMOKING");
        PreloadAnimLib(playerid,"FOOD");
        PreloadAnimLib(playerid,"ON_LOOKERS");
        PreloadAnimLib(playerid,"DEALER");
        PreloadAnimLib(playerid,"CRACK");
        PreloadAnimLib(playerid,"CARRY");
        PreloadAnimLib(playerid,"COP_AMBIENT");
        PreloadAnimLib(playerid,"PARK");
        PreloadAnimLib(playerid,"INT_HOUSE");
        PreloadAnimLib(playerid,"FOOD");
        PreloadAnimLib(playerid,"PED");
        PreloadAnimLib(playerid,"MISC");
        PreloadAnimLib(playerid,"BLOWJOBZ");
        PreloadAnimLib(playerid,"RIFLE");
        PreloadAnimLib(playerid,"UZI");
        PreloadAnimLib(playerid,"SHOTGUN");
        PreloadAnimLib(playerid,"COLT45");
        PreloadAnimLib(playerid,"SILENCED");
        PreloadAnimLib(playerid,"GYMNASIUM");
        PreloadAnimLib(playerid,"PARK");
        PreloadAnimLib(playerid,"BSKTBALL");
        PreloadAnimLib(playerid,"GANGS");
        PreloadAnimLib(playerid,"FIGHT_D");
        PreloadAnimLib(playerid,"PAULNMAC");
        gPlayerAnimLibsPreloaded[playerid] = 1;
        TogglePlayerSpectating(playerid, 0);
    }
    InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0 && IsPlayerNPC(playerid) != 1)
    {
        SendClientMessage(playerid, WHITE, "{6EF83C}INFO:{FFFFFF}Prvo mora da se registrirate pa da se prijavite.");
        KickPlayer[playerid] = 1;
    }
    if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
    {
        MedicBill[playerid] = 0;
        new rand = random(sizeof(CIV));
        SendClientMessage(playerid, WHITE, "{6EF83C}INFO:{FFFFFF}Ne ste iskusen vo rabotata Lider,sega ste civil.");
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
        PlayerInfo[playerid][pModel] = CIV[rand];
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 5)
    {
        if(PlayerInfo[playerid][pMember] < 1)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
            SendClientMessage(playerid, WHITE, "{6EF83C}INFO:{FFFFFF}Ne ste clen na organizacija, sega ste civil.");
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
            PlayerInfo[playerid][pModel] = CIV[rand];
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 10)
    {
        if(PlayerInfo[playerid][pMember] != 8)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
            SendClientMessage(playerid, WHITE, "{6EF83C}INFO:{FFFFFF}Ne ste clen na agencijata, sega ste civil.");
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
            PlayerInfo[playerid][pModel] = CIV[rand];
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
    {
        MedicBill[playerid] = 0;
        new rand = random(sizeof(CIV));
        SendClientMessage(playerid, WHITE, ""COL_RED"|DreamCast|{FFFFFF} Ne ste prijaveni za clen na "COL_RED"Drzavna Agencija!");
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
        PlayerInfo[playerid][pModel] = CIV[rand];
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 3)
    {
        if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0)
        {
            SendClientMessage(playerid, WHITE, ""COL_RED"|DreamCast|{FFFFFF} Ne ste clen na organizacija "COL_RED"Skin!");
            MedicBill[playerid] = 0;
            new model = PlayerInfo[playerid][pChar];
            if(PlayerInfo[playerid][pMember] == 1) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 2) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 3) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 4) { SetSpawnInfo(playerid, 1, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 5) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 6) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 7) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 8) { SetSpawnInfo(playerid, 10, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 9) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 10) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 12) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 13) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 14) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 15) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 16) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 1) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 2) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 3) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 4) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 5) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 6) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 7) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 8) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 9) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 10) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 12) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model;}
            else if(PlayerInfo[playerid][pLeader] == 13) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model;}
            else if(PlayerInfo[playerid][pLeader] == 14) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model;}
            else if(PlayerInfo[playerid][pLeader] == 15) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 16) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            SpawnPlayer(playerid);
        }
    }
    if(PlayerInfo[playerid][pEmail] == 0)
    {
        ShowPlayerDialog(playerid, 9812,DIALOG_STYLE_INPUT,"Email Adresa","Vnesete ja vasata Email Adresa\ndokolku dojde do hakirajne na acc\nke vi bide ispratena na email","Vnesi","");
    }
    if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
    else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
    SetPlayerSpawn(playerid);
    SetPlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    PlayerFixRadio(playerid);
    if(MapIconsShown[playerid] != 1)
    {
        MapIconsShown[playerid] = 1;
        for(new i = 0; i < sizeof(BizzInfo); i++)
        {
            SetPlayerMapIcon(playerid,i + 1,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ],56,YELLOW);
        }
        for(new i = 0; i < sizeof(SBizzInfo); i++)
        {
            SetPlayerMapIcon(playerid,i + 20,SBizzInfo[i][sbEntranceX],SBizzInfo[i][sbEntranceY],SBizzInfo[i][sbEntranceZ],56,COLOR_ZELENKASTA);
        }
    }
    return 1;
}
OnPlayerDeath

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    //new dmessage[128];
    //new deathreason[20];
    new playercash;
    new victimteam;
    new Float:px,Float:py,Float:pz;
    new killerteam;

    TazerAcceso[playerid] = 0;

    SetPVarInt(playerid, "Krepo", 1);
    victimteam = gTeam[playerid];
    killerteam = gTeam[killerid];
    gPlayerSpawned[playerid] = 0;
    PlayerInfo[playerid][pInvWeapon] = 0;
    PlayerInfo[playerid][pSmrt] = 1;
    PlayerInfo[playerid][pInvAmmo] = 0;
    GetPlayerName(playerid, name, sizeof(name));
    PlayerInfo[playerid][pLocal] = 255;
    GetPlayerPos(playerid, px, py, pz);
    {
    if(PlayerInfo[playerid][pSmrt] == 1)
    {
        SetPlayerSpawn(playerid);
        TogglePlayerControllable(playerid, 0);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Vie legate vo bolnica...", 15000, 3);
        SendClientMessage(playerid, COLOR_RED, " Tesko ste povredeni , Prefrleni ste vo Bolnica.");
        SetTimer("Cekanje", 15000, false, "i", playerid);
        PlayerInfo[playerid][pSmrt] = 1;
        return 1;
    }
        if(GetPlayerState(killerid) == 2)
        {
            if(ProxDetectorS(20, killerid, playerid))
            {
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    if(PlayerInfo[killerid][pMember] == 1||PlayerInfo[killerid][pLeader] == 1||PlayerInfo[killerid][pMember] == 2||PlayerInfo[killerid][pLeader] ==2)
                    {
                        SendClientMessage(killerid, COLOR_YELLOW, "{6EF83C}INFO:{FFFFFF} Napravivte Drive-By.");
                        return 1;
                    }
                    SetPlayerCriminal(killerid,255,"Ubistvo");
                    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
                    return 1;
                }
            }
        }
    }
    if (PlayerInfo[killerid][pAdmin] < 1)
    {
        if(reason == 38)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so minigun.",killerid,kickname,playerid,name);
                ABroadCast(COLOR_RED,string,1);
                printf("%s", kstring);
                //Ban(killerid);
            }
        }
        if(reason == 35)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so flamethrower.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
                Ban(killerid);
            }
        }
        if(reason == 9)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so motorna pila.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
                Ban(killerid);
            }
        }
        if(reason == 16)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so bombi i e kiknat.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
                Ban(killerid);
            }
        }
        if(reason == 18)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "DreamCast [%d]%s go ubi [%d]%s so molotov.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
                Ban(killerid);
            }
        }
        if(reason == 28)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so Mac 10.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
            }
        }
        if(reason == 32)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so Tec 9.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
            }
        }
        if(reason == 36)
        {
            new kstring[128];
            new kickname[MAX_PLAYER_NAME];
            if(IsPlayerConnected(killerid))
            {
                GetPlayerName(killerid, kickname, sizeof(kickname));
                format(string, 256, "[%d]%s go ubi [%d]%s so Lock On Launcher.",killerid,playerid,name);
                ABroadCast(COLOR_WHITE,string,1);
                printf("%s", kstring);
                Ban(killerid);
            }
        }
    }
    if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
    {
        DisablePlayerCheckpoint(playerid);
        gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
    }
    new caller = Mobile[playerid];
    if(caller != 255)
    {
        if(caller < 255)
        {
            SendClientMessage(caller,  COLOR_WHITE, "{6EF83C}INFO:{FFFFFF} Povikot e prekinat.");
            CellTime[caller] = 0;
            CellTime[playerid] = 0;
            Mobile[caller] = 255;
        }
        Mobile[playerid] = 255;
        CellTime[playerid] = 0;
    }
    ClearCrime(playerid);
    if(GettingCK[playerid] < 999)
    {
        if(IsPlayerConnected(killerid))
        {
            if(OnCK[killerid] < 999)
            {
                new killer[MAX_PLAYER_NAME];
                new dier[MAX_PLAYER_NAME];
                GetPlayerName(playerid, dier, sizeof(dier));
                GetPlayerName(killerid, killer, sizeof(killer));
                format(string, sizeof(string), "* %s je izvrsio Character Kill na vama, ne mozete igrati sa vasim likom vise.",killer);
                SendClientMessage(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), "** %s je izvrsio Character Kill na %s **",killer,dier);
                CKLog(string);
                BroadCast(COLOR_WHITE, string);
                PlayerInfo[playerid][pCK] = 1;
                if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
                else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
                if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
                else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
                KickPlayer[playerid] = 1;
            }
        }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(gTeam[killerid] == 10 || PlayerInfo[killerid][pLeader] == 8)
            {
                if(GoChase[killerid] == playerid)
                {
                    ConsumingMoney[killerid] = 1;
                    new killer[MAX_PLAYER_NAME];
                    GetPlayerName(killerid, killer, sizeof(killer));
                    GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
                    format(string,128,"Agent %s go izvrsi naracanoto ubistvo %s i zaraboti $%d",killer,name,PlayerInfo[playerid][pHeadValue]);
                    SendFamilyMessage(8, COLOR_YELLOW, string);
                    PlayerInfo[playerid][pHeadValue] = 0;
                    GotHit[playerid] = 0;
                    GetChased[playerid] = 999;
                    GoChase[killerid] = 999;
                }
            }
        }
    }
    if(victimteam >= 4)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            new slice = 100; //$100
            playercash = GetPlayerMoney(playerid);
            if(gTeam[killerid] != 2) { WantedPoints[killerid] += 2; } //+ 2 wanted points
            if(SafeTime[playerid] <= 0)
            {
                if(gTeam[killerid] != gTeam[playerid])
                {
                    if(GetPlayerState(killerid) == 1)
                    {
                        PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 2;
                    }
                    else
                    {
                        PlayerInfo[killerid][pKills]++;
                    }
                    PlayerInfo[playerid][pKills]--;
                }
            }

            if (((gTeam[killerid]) == 1) || ((gTeam[killerid]) == 3 && civnokill) || (gTeam[killerid] == gTeam[playerid] && gTeam[playerid] != 4))
            {
                slice = 0;
            }
            if (((gTeam[killerid]) != 4) && ((gTeam[killerid]) == gTeam[playerid]))//no team kill
            {
                slice = 0;
            }
            if (playercash > 0)
            {
                GivePlayerCash(playerid, -slice);
            }
            else
            {
                slice = slice+500;
            }
            //GivePlayerCash(killerid, slice);
            //GameTextForPlayer(playerid, dmessage, 5000, 2);
            PlayerPlaySound(killerid, 1083, 0.0, 0.0, 0.0);
            if (((gTeam[killerid]) == 3) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Ubistvo.");
            }
            else if (((gTeam[killerid]) == 3) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, ".");
            }
        }
    }
    else if (victimteam == 2)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Cop kill
            PlayerInfo[playerid][pKills]--;
            if (gTeam[killerid] == 2)//cops kill cop
            {
                //format(string,128,".: Officer %s murdered Officer %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerCash(killerid, -suecost);
                GivePlayerCash(playerid, suecost+100);//+100pays hospital bill
            }
            else
            {
                //format(string,128,".: %s murdered Officer %s (%s) :.",killer,name,deathreason);
            }
            if (gTeam[killerid] >= 3)
            {
                WantedPoints[killerid] += 2; //+ 2 wanted points
                if(reason != 49)
                {
                    SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Ubistvo.");
                }
                else if (reason == 49)
                {
                    SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Udiranje na covek.");
                }
            }
            if(gTeam[killerid] >= 5 && SafeTime[playerid] <= 0)
            {
                if(GetPlayerState(killerid) == 1)
                {
                    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+2;
                }
                else
                {
                    PlayerInfo[killerid][pKills]++;
                }
                WantedPoints[killerid]+=2;
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    else if (victimteam == 3)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Civ kill
            if ((gTeam[killerid]) == 2)//cops kill civ
            {
                if(WantedLevel[playerid] < 1)
                {
                    //format(string,128,".: Officer %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
                    PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                    GivePlayerCash(killerid, -suecost);
                    GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
                }
            }
            else
            {
                //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
                WantedPoints[killerid] += 2;
            }
            if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Ubistvo.");
            }
            else if (((gTeam[killerid]) >= 3 || (gTeam[killerid]) == 1) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Udiranje na covek.");
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    else if (victimteam == 1)
    {
        if(IsPlayerConnected(killerid))
        {
            //new killer[MAX_PLAYER_NAME];
            //GetPlayerName(killerid, killer, sizeof(killer));
            // Civ kill
            if ((gTeam[killerid]) == 2)//cops kill civ
            {
                //format(string,128,".: Officer %s murdered Paramedic %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerCash(killerid, -suecost);
                GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
            }
            else if ((gTeam[killerid]) == 1)//med kill civ
            {
                //format(string,128,".: Paramedic %s murdered %s (%s) and was sued for $%d :.",killer,name,deathreason,suecost);
                PlayerPlaySound(killerid, 1084, 0.0, 0.0, 0.0);
                GivePlayerCash(killerid, -suecost);
                GivePlayerCash(playerid, suecost+10);//+100pays hospital bill
            }
            else
            {
                //format(string,128,".: %s murdered %s (%s) :.",killer,name,deathreason);
            }
            if (((gTeam[killerid]) == 4) && reason != 49)
            {
                SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Ubistvo.");
            }
            else if (((gTeam[killerid]) == 3) && reason == 49)
            {
                SetPlayerCriminal(killerid,255, "{6EF83C}INFO:{FFFFFF} Udiranje na covek.");
            }
            //BroadCast(COLOR_RED, string);
        }
    }
    if (victimteam >= 3 && WantedPoints[playerid] > 0 && killerteam == 2)
    {
        SetPlayerFree(playerid,killerid, "{6EF83C}INFO:{FFFFFF} E ubien.");
    }
    if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0)
    {
        if (BusrouteEast[playerid][0] != 0) BusrouteEnd(playerid, BusrouteEast[playerid][1]);
        else if (BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, BusrouteWest[playerid][1]);
        else BusrouteEnd(playerid, 0);
    }
    if(FarmerVar[playerid] != 0)
    {
        FarmerVar[playerid] = 0;
        DisablePlayerCheckpoint(playerid);
    }
    if(DrugFarmerVar[playerid] != 0)
    {
        DrugFarmerVar[playerid] = 0;
        DisablePlayerCheckpoint(playerid);
    }
    if(SmugglerWork[playerid] != 0)
    {
        SmugglerWork[playerid] = 0;
        DisablePlayerCheckpoint(playerid);
    }
    if(playerid == CashboxOwner)
    {
        new str[128], pName[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "%s (ID: %d) umre i ja ispusti torbickata so pari.", pName, playerid);
        SendClientMessageToAll(0xFFD700AA, str);
        CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);
        CashboxOwner = INVALID_PLAYER_ID;
    }
    if(playerid == DrogaVlasnik)
    {
        new str[128], pName[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, DrogaX, DrogaY, DrogaZ);
        GetPlayerName(playerid, pName, sizeof(pName));
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5 || PlayerInfo[i][pMember] == 6 || PlayerInfo[i][pLeader] == 6 || PlayerInfo[i][pMember] == 12 || PlayerInfo[i][pLeader] == 12 || PlayerInfo[i][pMember] == 13 || PlayerInfo[i][pLeader] == 13 || PlayerInfo[i][pLeader] == 14 ||PlayerInfo[i][pMember] == 14 || PlayerInfo[i][pMember] == 15 || PlayerInfo[i][pLeader] == 15 || PlayerInfo[i][pMember] == 16 || PlayerInfo[i][pLeader] == 16)
                {
                    format(str, 128, "{FFFFFF}%s {FFD700}umre i go ispusti paketot so droga.", pName);
                    SendClientMessage(i,0xFFD700AA,  str);
                    DisablePlayerCheckpoint(playerid);
                }
            }
        }
        DrogaPickup = CreatePickup(1279, 3, DrogaX, DrogaY, DrogaZ);
        DrogaPickupStvoren = 1;
        DrogaVlasnik = INVALID_PLAYER_ID;
    }
    killerid = INVALID_PLAYER_ID;
    SetPlayerColor(playerid,COLOR_GRAD2);
    return 1;
}
Reply
#4

Try using a Player var instead of global var for

pawn Код:
logintimer = SetTimerEx("TimerZaLogin", 7000, false, "i", playerid); // LOGIN TIMER
to

pawn Код:
logintimer[playerid] = SetTimerEx("TimerZaLogin", 7000, false, "i", playerid); // LOGIN TIMER
and if you don't know

Define with new logintimer[MAX_PLAYERS];

and kill the timer with KillTimer(logintimer[playerid]);
Reply
#5

Where to put Killtimer ?
Reply
#6

You already have killtimer
Reply
#7

Show me erors :/

pawn Код:
Line: 4767
Line: error 001: expected token: ";", but found "]"
Line: logintimer[playerid] = SetTimerEx("TimerZaLogin", 7000, false, "i", playerid); // LOGIN TIMER
Reply
#8

Again show me a login :@:@:@::@
Reply
#9

Do you define the Playervar?

pawn Код:
new logintimer[MAX_PLAYERS];
?

or what are the line up and down the line of error?


EDIT: are you sure that you don't call the login function in any other function you have? btw the timer don't need the killtimer and the define becouse its not a repeating timer
Reply
#10

But now ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)