Jump to content
  • 0

Decrease Wanted Level


NEoNX

Question

6 answers to this question

Recommended Posts

Trebuie sa faci un timer, individual pentru player sau pentru toti playeri. (SetTimerEx, respectiv SetTimer).

Dupa sa, cand il actiuneaza sa te folosesti de [pawn]GetPlayerWantedLevel[/pawn] ca sa ii iei wanted level-ul, si [pawn]SetPlayerWantedLevel[/pawn] (aici trebuie sa-l scazi).

Link to comment
Share on other sites

Parerea mea , este ca e mai simplu sa faci cu SetTimer (pt toti playerii) nu SetTimerEx (pt 1 player) la OnGameModeInit faci timeru :) si la publicu' respectiv faci asa :

for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerWantedLevel(i,GetPlayerWantedLevel(i) - 1);
}
}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Pai am incercat dupa cum mi-ati zis :

[pawn]new WLD;

forward WantedLevelDown(playerid);

public WantedLevelDown(playerid)

{

    if(GetPlayerWantedLevel(playerid) == 10)

{

PlayerInfo[playerid][pWantedLevel] = 9;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 9");

}

    else if(GetPlayerWantedLevel(playerid) == 9)

{

PlayerInfo[playerid][pWantedLevel] = 8;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 8");

}

    else if(GetPlayerWantedLevel(playerid) == 8)

{

PlayerInfo[playerid][pWantedLevel] = 7;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 7");

}

    else if(GetPlayerWantedLevel(playerid) == 7)

{

PlayerInfo[playerid][pWantedLevel] = 6;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 6");

}

    else if(GetPlayerWantedLevel(playerid) == 6)

{

PlayerInfo[playerid][pWantedLevel] = 5;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 5");

}

    else if(GetPlayerWantedLevel(playerid) == 5)

{

PlayerInfo[playerid][pWantedLevel] = 4;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 4");

}

    else if(GetPlayerWantedLevel(playerid) == 4)

{

PlayerInfo[playerid][pWantedLevel] = 3;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 3");

}

    else if(GetPlayerWantedLevel(playerid) == 3)

{

PlayerInfo[playerid][pWantedLevel] = 2;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 2");

}

    else if(GetPlayerWantedLevel(playerid) == 2)

{

PlayerInfo[playerid][pWantedLevel] = 1;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 1");

}

    else if(GetPlayerWantedLevel(playerid) == 1)

    {

        PlayerInfo[playerid][pWantedLevel] = 0;

        KillTimer(WLD);

        SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 0");

    }

    return 1;

}

WLD = SetTimer("WantedLevelDown", 120000, false);[/pawn]

dar nu prea merge .. Am facut-o rau ?

Link to comment
Share on other sites

Pai am incercat dupa cum mi-ati zis :

[pawn]new WLD;

forward WantedLevelDown(playerid);

public WantedLevelDown(playerid)

{

    if(GetPlayerWantedLevel(playerid) == 10)

{

PlayerInfo[playerid][pWantedLevel] = 9;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 9");

}

    else if(GetPlayerWantedLevel(playerid) == 9)

{

PlayerInfo[playerid][pWantedLevel] = 8;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 8");

}

    else if(GetPlayerWantedLevel(playerid) == 8)

{

PlayerInfo[playerid][pWantedLevel] = 7;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 7");

}

    else if(GetPlayerWantedLevel(playerid) == 7)

{

PlayerInfo[playerid][pWantedLevel] = 6;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 6");

}

    else if(GetPlayerWantedLevel(playerid) == 6)

{

PlayerInfo[playerid][pWantedLevel] = 5;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 5");

}

    else if(GetPlayerWantedLevel(playerid) == 5)

{

PlayerInfo[playerid][pWantedLevel] = 4;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 4");

}

    else if(GetPlayerWantedLevel(playerid) == 4)

{

PlayerInfo[playerid][pWantedLevel] = 3;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 3");

}

    else if(GetPlayerWantedLevel(playerid) == 3)

{

PlayerInfo[playerid][pWantedLevel] = 2;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 2");

}

    else if(GetPlayerWantedLevel(playerid) == 2)

{

PlayerInfo[playerid][pWantedLevel] = 1;

SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 1");

}

    else if(GetPlayerWantedLevel(playerid) == 1)

    {

        PlayerInfo[playerid][pWantedLevel] = 0;

        KillTimer(WLD);

        SendClientMessage(playerid, COLOR_YELLOW, "Current Wanted Level: 0");

    }

    return 1;

}

WLD = SetTimer("WantedLevelDown", 120000, false);[/pawn]

dar nu prea merge .. Am facut-o rau ?

[pawn]new WLD[MAX_PLAYERS];

WLD[playerid] = SetTimer("WantedLevelDown", 120000,  true, "i", playerid); // Asta e doar pentru un player[/pawn]

Asta o pui atunci cand face crima sau primeste wanted, etc..

Ce ai facut tu acolo e gresit, cand ai pus timer-ul.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.