SA-MP Forums Archive
HELP MONEY FOR KILLER - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP MONEY FOR KILLER (/showthread.php?tid=558767)



HELP MONEY FOR KILLER - Mijata - 18.01.2015

how to add here when player kill player he got 100 $

Код:
    SendDeathMessage(killerid, playerid, reason);

    new cash = random(100);
    format(gString, 100, "You have killed %s and got $%d and + 1 score!", PlayerName(playerid), cash);
    SendClientMessage(killerid, GREEN, gString);
    format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
    SendClientMessage(playerid, RED, gString);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(playerid, cash);

    pInfo[playerid][Spawned]    = 0;
    pInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		pInfo[killerid][Kills]++;
	}
	return 1;
}



Re: HELP MONEY FOR KILLER - Schneider - 18.01.2015

Just change playerid to killerid in the GivePlayerMoney function


Re: HELP MONEY FOR KILLER - Ironboy - 18.01.2015

pawn Код:
GivePlayerCash(killerid,100);



Re: HELP MONEY FOR KILLER - Rockyyy - 18.01.2015

GivePlayerMoney(killerid,100);


Re: HELP MONEY FOR KILLER - JaydenJason - 18.01.2015

Quote:
Originally Posted by Mijata
Посмотреть сообщение
how to add here when player kill player he got 100 $

Код:
    SendDeathMessage(killerid, playerid, reason);

    new cash = random(100);
    format(gString, 100, "You have killed %s and got $%d and + 1 score!", PlayerName(playerid), cash);
    SendClientMessage(killerid, GREEN, gString);
    format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
    SendClientMessage(playerid, RED, gString);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(playerid, cash);

    pInfo[playerid][Spawned]    = 0;
    pInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		pInfo[killerid][Kills]++;
	}
	return 1;
}
Код:
    SendDeathMessage(killerid, playerid, reason);

    new cash = random(100);
    format(gString, 100, "You have killed %s and got $%d and + 1 score!", PlayerName(playerid), cash);
    SendClientMessage(killerid, GREEN, gString);
    format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
    SendClientMessage(playerid, RED, gString);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, cash); // killerid instead of playerid, read above ^^

    pInfo[playerid][Spawned]    = 0;
    pInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		pInfo[killerid][Kills]++;
	}
	return 1;
}



Re: HELP MONEY FOR KILLER - Mijata - 18.01.2015

Код:
    SendDeathMessage(killerid, playerid, reason);

    new cash = random(100);
    format(gString, 100, "You have killed %s and got $%d and + 1 score!", PlayerName(playerid), cash);
    SendClientMessage(killerid, GREEN, gString);
    format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
    SendClientMessage(playerid, RED, gString);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, 100); 

    pInfo[playerid][Spawned]    = 0;
    pInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		pInfo[killerid][Kills]++;
	}
	return 1;
}
it?


Re: HELP MONEY FOR KILLER - DanishHaq - 18.01.2015

That should work, unless you have a server-side anti-money-hack it will work.


Re: HELP MONEY FOR KILLER - Rockyyy - 18.01.2015

Quote:
Originally Posted by Mijata
Посмотреть сообщение
Код:
    SendDeathMessage(killerid, playerid, reason);

    new cash = random(100);
    format(gString, 100, "You have killed %s and got $%d and + 1 score!", PlayerName(playerid), cash);
    SendClientMessage(killerid, GREEN, gString);
    format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
    SendClientMessage(playerid, RED, gString);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, 100); 

    pInfo[playerid][Spawned]    = 0;
    pInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		pInfo[killerid][Kills]++;
	}
	return 1;
}
it?
Yeah try with this


Re: HELP MONEY FOR KILLER - Mijata - 18.01.2015

i must to test it can somebody come to my server i don't have players to kill