HELP MONEY FOR KILLER
#1

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;
}
Reply
#2

Just change playerid to killerid in the GivePlayerMoney function
Reply
#3

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

GivePlayerMoney(killerid,100);
Reply
#5

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;
}
Reply
#6

Код:
    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?
Reply
#7

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

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 3 Guest(s)