Give Player Money if kill other players
#1

How do i do it? O_O

can someone help me?
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(playerid != INVALID_PLAYER_ID & killerid != INVALID_PLAYER_ID & playerid != killerid) { GivePlayerMoney(killerid, 1000); }
    return 1;
}
Reply
#3

where i put it?

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	new str[128];
    PlayerAcc[killerid][Kills]++;
    PlayerAcc[playerid][Deaths]++;
    StopAudioStreamForPlayer(playerid);
	if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player, i)
        {
            if(spectatorid[i] == playerid)
            {
                KillTimer(SpecTimer[i]);
				StopSpectate(i);
				format(str, sizeof(str), "Your spectating to %s(%d) has been ended (Reason: Player Death)", GetName(playerid), playerid);
                SendClientMessage(i, COLOR_RED, str);
            }
        }
    }
	if(gPlayerUsingLoopingAnim[playerid])
	{
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid, txtAnimHelper);
	}
	if(PlayerAcc[playerid][pDuty] == 1)
    {
		GameTextForPlayer(playerid, "~w~Admin Duty ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your Admin Duty has been ended, You die!");
	    PlayerAcc[playerid][pDuty] = 0;
	    KillTimer(HealthTimer[playerid]);
	    SetPlayerColor(playerid, GetPVarInt(playerid, "MyColor"));
	    Delete3DTextLabel(Duty[playerid]);
    }
    if(PlayerAcc[playerid][God] == 1)
    {
		GameTextForPlayer(playerid, "~w~God Mode ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your God Mode has been ended, You die!");
	    PlayerAcc[playerid][God] = 0;
	    KillTimer(HealthTimer[playerid]);
	    Delete3DTextLabel(GodM[playerid]);
    }
    if(GetPlayerMoney(playerid) >= 1)
    {
        GivePlayerMoney(playerid, -1);
    }
    else return SendClientMessage(playerid, COLOR_RED, "The Server didn't take your score, Because you don't have score");
	return 1;
}
Reply
#4

:l at the top of onplayerdeath?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
         if(playerid != INVALID_PLAYER_ID & killerid != INVALID_PLAYER_ID & playerid != killerid) {     GivePlayerMoney(killerid, 1000); }
    SendDeathMessage(killerid, playerid, reason);
    new str[128];
    PlayerAcc[killerid][Kills]++;
    PlayerAcc[playerid][Deaths]++;
    StopAudioStreamForPlayer(playerid);
    if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player, i)
        {
            if(spectatorid[i] == playerid)
            {
                KillTimer(SpecTimer[i]);
                StopSpectate(i);
                format(str, sizeof(str), "Your spectating to %s(%d) has been ended (Reason: Player Death)", GetName(playerid), playerid);
                SendClientMessage(i, COLOR_RED, str);
            }
        }
    }
    if(gPlayerUsingLoopingAnim[playerid])
    {
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid, txtAnimHelper);
    }
    if(PlayerAcc[playerid][pDuty] == 1)
    {
        GameTextForPlayer(playerid, "~w~Admin Duty ~r~Ended!", 4000, 3);
        SendClientMessage(playerid, COLOR_RED, "Your Admin Duty has been ended, You die!");
        PlayerAcc[playerid][pDuty] = 0;
        KillTimer(HealthTimer[playerid]);
        SetPlayerColor(playerid, GetPVarInt(playerid, "MyColor"));
        Delete3DTextLabel(Duty[playerid]);
    }
    if(PlayerAcc[playerid][God] == 1)
    {
        GameTextForPlayer(playerid, "~w~God Mode ~r~Ended!", 4000, 3);
        SendClientMessage(playerid, COLOR_RED, "Your God Mode has been ended, You die!");
        PlayerAcc[playerid][God] = 0;
        KillTimer(HealthTimer[playerid]);
        Delete3DTextLabel(GodM[playerid]);
    }
    if(GetPlayerMoney(playerid) >= 1)
    {
        GivePlayerMoney(playerid, -1);
    }
    else return SendClientMessage(playerid, COLOR_RED, "The Server didn't take your score, Because you don't have score");
    return 1;
}
Reply
#5

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new str[128];
    PlayerAcc[killerid][Kills]++;
    PlayerAcc[playerid][Deaths]++;
    StopAudioStreamForPlayer(playerid);
    if(killerid != INVALID_PLAYER_ID)
    {
    GivePlayerMoney(killerid,1000);
    }
	if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player, i)
        {
            if(spectatorid[i] == playerid)
            {
                KillTimer(SpecTimer[i]);
				StopSpectate(i);
				format(str, sizeof(str), "Your spectating to %s(%d) has been ended (Reason: Player Death)", GetName(playerid), playerid);
                SendClientMessage(i, COLOR_RED, str);
            }
        }
    }
	if(gPlayerUsingLoopingAnim[playerid])
	{
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid, txtAnimHelper);
	}
	if(PlayerAcc[playerid][pDuty] == 1)
    {
		GameTextForPlayer(playerid, "~w~Admin Duty ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your Admin Duty has been ended, You die!");
	    PlayerAcc[playerid][pDuty] = 0;
	    KillTimer(HealthTimer[playerid]);
	    SetPlayerColor(playerid, GetPVarInt(playerid, "MyColor"));
	    Delete3DTextLabel(Duty[playerid]);
    }
    if(PlayerAcc[playerid][God] == 1)
    {
		GameTextForPlayer(playerid, "~w~God Mode ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your God Mode has been ended, You die!");
	    PlayerAcc[playerid][God] = 0;
	    KillTimer(HealthTimer[playerid]);
	    Delete3DTextLabel(GodM[playerid]);
    }
    if(GetPlayerMoney(playerid) >= 1)
    {
        GivePlayerMoney(playerid, -1);
    }
    else return SendClientMessage(playerid, COLOR_RED, "The Server didn't take your score, Because you don't have score");
	return 1;
}
Reply
#6

Quote:
Originally Posted by Eth
Посмотреть сообщение
:l at the top of onplayerdeath?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
         if(playerid != INVALID_PLAYER_ID & killerid != INVALID_PLAYER_ID & playerid != killerid) {     GivePlayerMoney(killerid, 1000); }
    SendDeathMessage(killerid, playerid, reason);
    new str[128];
    PlayerAcc[killerid][Kills]++;
    PlayerAcc[playerid][Deaths]++;
    StopAudioStreamForPlayer(playerid);
    if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player, i)
        {
            if(spectatorid[i] == playerid)
            {
                KillTimer(SpecTimer[i]);
                StopSpectate(i);
                format(str, sizeof(str), "Your spectating to %s(%d) has been ended (Reason: Player Death)", GetName(playerid), playerid);
                SendClientMessage(i, COLOR_RED, str);
            }
        }
    }
    if(gPlayerUsingLoopingAnim[playerid])
    {
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid, txtAnimHelper);
    }
    if(PlayerAcc[playerid][pDuty] == 1)
    {
        GameTextForPlayer(playerid, "~w~Admin Duty ~r~Ended!", 4000, 3);
        SendClientMessage(playerid, COLOR_RED, "Your Admin Duty has been ended, You die!");
        PlayerAcc[playerid][pDuty] = 0;
        KillTimer(HealthTimer[playerid]);
        SetPlayerColor(playerid, GetPVarInt(playerid, "MyColor"));
        Delete3DTextLabel(Duty[playerid]);
    }
    if(PlayerAcc[playerid][God] == 1)
    {
        GameTextForPlayer(playerid, "~w~God Mode ~r~Ended!", 4000, 3);
        SendClientMessage(playerid, COLOR_RED, "Your God Mode has been ended, You die!");
        PlayerAcc[playerid][God] = 0;
        KillTimer(HealthTimer[playerid]);
        Delete3DTextLabel(GodM[playerid]);
    }
    if(GetPlayerMoney(playerid) >= 1)
    {
        GivePlayerMoney(playerid, -1);
    }
    else return SendClientMessage(playerid, COLOR_RED, "The Server didn't take your score, Because you don't have score");
    return 1;
}
Thanks!

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new str[128];
    PlayerAcc[killerid][Kills]++;
    PlayerAcc[playerid][Deaths]++;
    StopAudioStreamForPlayer(playerid);
    if(killerid != INVALID_PLAYER_ID)
    {
    GivePlayerMoney(killerid,1000);
    }
	if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player, i)
        {
            if(spectatorid[i] == playerid)
            {
                KillTimer(SpecTimer[i]);
				StopSpectate(i);
				format(str, sizeof(str), "Your spectating to %s(%d) has been ended (Reason: Player Death)", GetName(playerid), playerid);
                SendClientMessage(i, COLOR_RED, str);
            }
        }
    }
	if(gPlayerUsingLoopingAnim[playerid])
	{
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid, txtAnimHelper);
	}
	if(PlayerAcc[playerid][pDuty] == 1)
    {
		GameTextForPlayer(playerid, "~w~Admin Duty ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your Admin Duty has been ended, You die!");
	    PlayerAcc[playerid][pDuty] = 0;
	    KillTimer(HealthTimer[playerid]);
	    SetPlayerColor(playerid, GetPVarInt(playerid, "MyColor"));
	    Delete3DTextLabel(Duty[playerid]);
    }
    if(PlayerAcc[playerid][God] == 1)
    {
		GameTextForPlayer(playerid, "~w~God Mode ~r~Ended!", 4000, 3);
	    SendClientMessage(playerid, COLOR_RED, "Your God Mode has been ended, You die!");
	    PlayerAcc[playerid][God] = 0;
	    KillTimer(HealthTimer[playerid]);
	    Delete3DTextLabel(GodM[playerid]);
    }
    if(GetPlayerMoney(playerid) >= 1)
    {
        GivePlayerMoney(playerid, -1);
    }
    else return SendClientMessage(playerid, COLOR_RED, "The Server didn't take your score, Because you don't have score");
	return 1;
}
Thanks too!

1 question again

how do i remove 1$=1 Score?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)