[Pedido] Mortes... granas...
#1

"estou criando esse post por que nгo achei no search" pessoal queria um comando para ganhar dinheiro por matar player, mais nгo sу isso, ex: um player que nasceu agora a morte dele vale 300, mais se ele mata 1 quem matar ele passa a ganhar 1300 e se ele matar outro antes de morrer ele vai passar a valer 2300 e assim sucessivamente, atй ele morrer e voltar a valer 300, tem como? pode me dar o code?
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=446719 ~> Faзa seu pedido e evite mais um tуpico!
Reply
#3

Cara, super simples se for como eu estou pensando...

Exemplinho:
pawn Код:
new valor_da_cabesa_do_champs_HAEUAEH[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    valor_da_cabesa_do_champs_HAEUAEH[playerid] = 300;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid != INVALID_PLAYER_ID)
    {
        GivePlayerMoney(playerid, +valor_da_cabesa_do_champs_HAEUAEH[playerid]);
        valor_da_cabesa_do_champs_HAEUAEH[killerid] += 1000;
    }
    return 1;
}
Ai jб estб do jeito que tu pediu, veja se te agrada.


Abraзos.
Reply
#4

Meu GM esta assim

Код:
new gHeadValue[MAX_PLAYERS];
new Float:RandomSpawn[][4] =
{
    // Positions, (X, Y, Z and Facing Angle)
	{-205.7703,-119.6655,2.4094,342.0546},
	{-202.1386,-54.1213,2.4111,95.6799},
	{-197.2334,7.5293,2.4034,16.0852},
	{-135.7348,61.7265,2.4112,354.3534},
	{-73.7883,73.4238,2.4082,260.5399},
	{-6.9850,27.9988,2.4112,201.7691},
	{0.6782,-16.0898,2.4076,161.7720},
	{-46.3365,-88.3937,2.4092,180.7382},
	{-72.4389,-127.2939,2.4107,113.5616},
	{-128.1940,-144.1725,2.4094,78.9676},
	{-266.0189,-50.6718,2.4125,223.8079},
	{-244.2617,-1.0468,2.1038,257.3333},
	{-93.3146,-32.4889,2.4085,186.0631},
	{-130.7054,-93.4983,2.4124,73.8375},
	{-117.4049,4.2989,2.4112,337.1284},
	{-26.1622,135.8739,2.4094,248.1580},
	{45.5705,86.7586,2.0753,147.3342},
	{54.9881,2.2997,1.1132,95.7173},
	{-248.9905,-119.3982,2.4083,303.7859},
	{-60.1321,55.5239,2.4038,325.2209},
	{-60.9184,47.9302,5.7706,342.8299},
	{-70.0303,-22.0071,2.4113,165.2789},
	{-138.3093,-83.2640,2.4152,4.0455},
	{-25.5989,94.6100,2.4041,150.8322},
	{-161.0327,-70.5945,2.4042,142.9221},
	{1958.3783,1343.1572,15.3746},
	{2199.6531,1393.3678,10.8203},
	{2483.5977,1222.0825,10.8203},
	{2637.2712,1129.2743,11.1797},
	{2000.0106,1521.1111,17.0625},
	{2024.8190,1917.9425,12.3386},
	{2261.9048,2035.9547,10.8203},
	{2262.0986,2398.6572,10.8203},
	{2244.2566,2523.7280,10.8203},
	{2335.3228,2786.4478,10.8203},
	{2150.0186,2734.2297,11.1763},
	{2158.0811,2797.5488,10.8203},
	{1969.8301,2722.8564,10.8203},
	{1652.0555,2709.4072,10.8265},
	{1564.0052,2756.9463,10.8203},
	{1271.5452,2554.0227,10.8203},
	{1441.5894,2567.9099,10.8203},
	{1480.6473,2213.5718,11.0234},
	{1400.5906,2225.6960,11.0234},
	{1598.8419,2221.5676,11.0625},
	{1318.7759,1251.3580,10.8203},
	{1558.0731,1007.8292,10.8125},
	{1705.2347,1025.6808,10.8203},
	{-54.8308,-139.6148,2.4119,258.7639}
};

public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(RandomSpawn));

    // SetPlayerPos to the random spawn data
    SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);

    // SetPlayerFacingAngle to the random facing angle data
    SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
    GivePlayerWeapon(playerid,1,1);
	SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
	ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
	SetPlayerWantedLevel(playerid, 0);
	gHeadValue[playerid] = 300;
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    if (killerid != INVALID_PLAYER_ID)
    {
        GivePlayerMoney(playerid, gHeadValue[playerid]);
        gHeadValue[killerid] += 1000;
    }
	return 1;
}
mais nгo acontece nada no server
Reply
#5

Ha, fiz o cуdigo correndo acabei errando na hora de dar o dinheiro para o jogador que matou, desculpe.

pawn Код:
GivePlayerMoney(killerid, gHeadValue[playerid]);
Ou seja, ficaria assim:
pawn Код:
new gHeadValue[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    gHeadValue[playerid] = 300;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid != INVALID_PLAYER_ID)
    {
        GivePlayerMoney(killerid, gHeadValue[playerid]);
        gHeadValue[killerid] += 1000;
        SendClientMessage(killerid, -1, "Vocк matou mais um, agora sua cabeзa vale +R$1.000.");
        SendClientMessage(playerid, -1, "Vocк morreu e sua cabeзa voltou para o preзo de R$300.");
    }
    return 1;
}
Agora vai.
Reply
#6

DESCOBRI QUE ESTA AO COMTRARIO QUEM MORRE Й QUEM GANHA A GRANA, ALGUEM PODE ME AJUDA?
Reply
#7

Quote:
Originally Posted by Lateamcraft
Посмотреть сообщение
DESCOBRI QUE ESTA AO COMTRARIO QUEM MORRE Й QUEM GANHA A GRANA, ALGUEM PODE ME AJUDA?
Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Ha, fiz o cуdigo correndo acabei errando na hora de dar o dinheiro para o jogador que matou, desculpe.

pawn Код:
GivePlayerMoney(killerid, gHeadValue[playerid]);
Ou seja, ficaria assim:
pawn Код:
new gHeadValue[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    gHeadValue[playerid] = 300;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid != INVALID_PLAYER_ID)
    {
        GivePlayerMoney(killerid, gHeadValue[playerid]);
        gHeadValue[killerid] += 1000;
        SendClientMessage(killerid, -1, "Vocк matou mais um, agora sua cabeзa vale +R$1.000.");
        SendClientMessage(playerid, -1, "Vocк morreu e sua cabeзa voltou para o preзo de R$300.");
    }
    return 1;
}
Agora vai.
Jб fixei, teste.
Reply


Forum Jump:


Users browsing this thread: