Jump to content
  • 0

Question

Posted

Nick:NEoNX

Problema:As vrea sa stiu cum as putea sa fac un sistem care sa scada wanted-ul jucatorului la un interval de 2-3 minute .

Erori / warnings:-

Lini/script:-

Ai incercat sa rezolvi singur ?:nu . acum mi-a venit ideea ..

6 answers to this question

Recommended Posts

  • Administrator
Posted

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).

Posted

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;
}

 

Posted

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 ?

  • Administrator
Posted

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.

Posted

Eu am pus timer-ul la OnPlayerConnect , si merge .

Insa nu trebuie cu SetPlayerWantedLevel sau PlayerInfo[playerid][pWantedLevel] = etc . Trebuie pusa functia WantedLevel[playerid] -= 1; si va merge .

Topic Closed

Posted

Noi ne-am referit in general cu SetPlayerWantedLevel Acum daca tu ai altcumva nu e vina noastra

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

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.