SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/04/2014, 04:29 PM   #1
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Unhappy [question / help] +1 Score for murder with a fighter / tank / apache

hello
the problem is this: I need to when the player sitting in the fighter, tank or Apache and he somebody killed him (shot) that the murderer gave +1 Score
nothing I can not do
off site also do not know
help)
Rhymed32 is offline   Reply With Quote
Old 02/05/2014, 06:31 AM   #2
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

UP
Rhymed32 is offline   Reply With Quote
Old 02/05/2014, 06:33 AM   #3
BroZeus
High-roller
 
BroZeus's Avatar
 
Join Date: Jan 2014
Location: India
Posts: 1,405
Reputation: 173
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

do u want to give +1 score to person sitting in tank or the person who killed him?
__________________


"Be the change that you wish to see in the world."

Check out my Github profile!
BroZeus is offline   Reply With Quote
Old 03/05/2014, 05:09 AM   #4
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

Quote:
Originally Posted by BroZeus View Post
do u want to give +1 score to person sitting in tank or the person who killed him?
No! Look at this: you're sitting in the tank, the other player so zhe.Ty shoot him - he dies, and they give you one point, and the deceased -1
Rhymed32 is offline   Reply With Quote
Old 03/05/2014, 05:19 AM   #5
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,638
Reputation: 1185
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{

    if(killerid != INVALID_PLAYER_ID)
    {
        switch(GetPlayerVehicleID(killerid))
        {

            // Rhino and Hunter
            case 425, 432:
            {
                SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
                SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
            }
        }
    }

    return 1;
}
Dignity is offline   Reply With Quote
Old 04/05/2014, 07:56 AM   #6
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

does not work((
Rhymed32 is offline   Reply With Quote
Old 04/05/2014, 07:57 AM   #7
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,638
Reputation: 1185
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

It's an example of how it could be, make it yourself using my example.
Dignity is offline   Reply With Quote
Old 04/05/2014, 03:19 PM   #8
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

there may be other relevant options?
Rhymed32 is offline   Reply With Quote
Old 08/05/2014, 05:06 PM   #9
Rhymed32
Little Clucker
 
Join Date: Apr 2012
Posts: 47
Reputation: 19
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

UP!!!
Rhymed32 is offline   Reply With Quote
Old 08/05/2014, 05:13 PM   #10
Andreas1331
Big Clucker
 
Andreas1331's Avatar
 
Join Date: Apr 2014
Location: Denmark
Posts: 53
Reputation: 1
Default Re: [question / help] +1 Score for murder with a fighter / tank / apache

I'm pretty sure this works even if they're in a vehicle, but here you go. I gave it a shot..

Code:
public OnPlayerDeath(playerid, killerid, reason)
{
	if(killerid == INVALID_PLAYER_ID) // If suicide
	{
		printf("Player ID: [%d] has commited suicide.", playerid); // Prints the text
		SetPlayerScore(playerid, GetPlayerScore(playerid)-1); // Player will lose 1 score
		GivePlayerMoney(playerid,-250); // Player will lose $250
	}
	else if(killerid != INVALID_PLAYER_ID) // Killed by other player
	{
	    printf("Player ID: [%d] was killed by Player ID: [%d].", killerid, playerid); // Prints the text
	    SetPlayerScore(killerid, GetPlayerScore(killerid)+1); // Killer recieves 1 score
	    GivePlayerMoney(killerid,250); // Killer will get $250
	}
	SendDeathMessage(killerid, playerid, reason); // Kill is shown in the killfeed
	return 1;
}
__________________
Our Forum : www.a-rp.co.uk
The Gameserver : 37.187.183.200:7777
Andreas1331 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
php / apache question iJumbo Everything and Nothing 7 08/11/2013 09:20 PM
Certain Score To Enter Tank? <Weponz> Help Archive 4 01/12/2010 02:29 PM


All times are GMT. The time now is 04:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.