Jump to content
  • 0

pomoc /kill--přidává body


Guest AvEpl

Dotaz

Ahoj obejvil sem zde:

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kill", cmdtext, true, 10) == 0)

{

SetPlayerHealth(playerid,0.0);

SendClientMessage(playerid,BARVA_CERVENA,"Zabil jsi se!!");

return 1;

 

 

Ale když dám /kill tak to přidá bod jedné strane mohl by mi nekdo poradit jak udelat aby to nepřidávalo bod? Dekuji..

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

Taki videt nemuzes kdyz sem to sem nedal:D ja jen potřebuju upravit ten kod na /kill aby nepřídával žádný straně bod...Sry moc se v tom este nevyznám sem v tom teprv 2 den:D

Link to comment
Share on other sites

  • 0

tak tu je Score..

 

 

public OnPlayerDeath(playerid, killerid, reason)

{

SendDeathMessage(killerid, playerid, reason);

 

connect[playerid] = 1;

SetPlayerScore(killerid, GetPlayerScore(killerid)+1);

 

if(iPlayerRole[playerid] == 2 ) {

ScoreKill2++;

format(string, 256,"a_C %d : %d HOSTE",ScoreKill,ScoreKill2);

SendClientMessageToAll(BARVA_ZLUTA,string);

}

 

if(iPlayerRole[playerid] == 3) {

ScoreKill++;

format(string, 256,"a_C %d : %d HOSTE",ScoreKill,ScoreKill2);

SendClientMessageToAll(BARVA_ZLUTA,string);

}

 

if(ScoreKill2 == 30) {

ScoreKill = 0;

ScoreKill2 = 0;

ScoreKill2W++;

GameTextForAll("~r~HOSTE ~w~win ~g~round", 5000, 3);

format(string,sizeof(string),"Score round: a_C %d : %d HOSTE",ScoreKillW,ScoreKill2W);

SendClientMessageToAll(BARVA_MODRA,string);

}

 

if(ScoreKill == 30) {

ScoreKill = 0;

ScoreKill2 = 0;

ScoreKillW++;

GameTextForAll("~g~a_C ~w~win ~r~round", 5000, 3);

format(string,sizeof(string),"Score round: a_C %d : %d HOSTE",ScoreKillW,ScoreKill2W);

SendClientMessageToAll(BARVA_MODRA,string);

}

 

if(ScoreKill2W == 3) {

ScoreKill = 0;

ScoreKill2 = 0;

GameTextForAll("~g~Vitezem ~w~CW se stava ~r~HOSTE", 5000, 3);

SendClientMessageToAll(BARVA_CERVENA,"----------------------------------------------------------");

format(string,sizeof(string),"TOTAL score: a_C %d : %d HOSTE",ScoreKillW,ScoreKill2W);

SendClientMessageToAll(BARVA_CERVENA,"----------------------------------------------------------");

SendClientMessageToAll(BARVA_CERVENA,string);

ScoreKillW = 0;

ScoreKill2W = 0;

}

 

if(ScoreKillW == 3) {

ScoreKill = 0;

ScoreKill2 = 0;

GameTextForAll("~r~Vitezem ~w~CW se stava ~g~a_C", 5000, 3);

SendClientMessageToAll(BARVA_CERVENA,"----------------------------------------------------------");

format(string,sizeof(string),"TOTAL score: a_C %d : %d HOSTE",ScoreKillW,ScoreKill2W);

SendClientMessageToAll(BARVA_CERVENA,"----------------------------------------------------------");

SendClientMessageToAll(BARVA_CERVENA,string);

ScoreKillW = 0;

ScoreKill2W = 0;

Link to comment
Share on other sites

  • 0

Jde o to ze ten prikaz jen vyvola public OnPlayerDeath, kde se score pricita, dej si do prikazu promenou, kterou budes mit pri pricitani bodu

 

treba

 

/kill

promena[playerid] = 1;

 

f(iPlayerRole[playerid] == 2 && promena[playerid] == 0) {

ScoreKill2++;

format(string, 256,"a_C %d : %d HOSTE",ScoreKill,ScoreKill2);

SendClientMessageToAll(BARVA_ZLUTA,string);

}

 

if(iPlayerRole[playerid] == 3 && promena[playerid] == 0) {

ScoreKill++;

format(string, 256,"a_C %d : %d HOSTE",ScoreKill,ScoreKill2);

SendClientMessageToAll(BARVA_ZLUTA,string);

}

promena[playerid] = 0;

Link to comment
Share on other sites

  • 0

no ty vlastne k tomu svemu pridas promenou, ktera kontroluje pri pricitani bodu, jestli se zabil sam, nebo mu nekdo pomohl.

 

Nahoru do modu

new Sebevrazda[MAX_PLAYERS]; // definice promene

 

public OnPlayerConnected(playerid)

Sebevrazda = 0;

 

 

Do prikazu /kill

if (strcmp("/kill", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, BARVA_CERVENA, "Zabil jsi se!!");
Sebevrazda[playerid] = 1;
}

 

////// tak zatim mame nastaveni promene

 

public OnPlayerDeath(playerid, killerid, reason)

if(iPlayerRole[playerid] == 2 && Sebevrazda[playerid] == 0)  // zjistujeme kdyz ma promenou 2a nezabil se sam
{
ScoreKill2++;
format(string, 256, "a_C %d : %d HOSTE", ScoreKill, ScoreKill2);
SendClientMessageToAll(BARVA_ZLUTA, string);
}
if(iPlayerRole[playerid] == 3 && Sebevrazda[playerid] == 0) // kdyz ma promenou 3 a nezabil se sem
{
ScoreKill++;
format(string, 256,"a_C %d : %d HOSTE", ScoreKill, ScoreKill2);
SendClientMessageToAll(BARVA_ZLUTA,string);
}
Sebevrazda[playerid] = 0; // vynulovani promene na konci publicu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...