SA-MP Forums Archive
Help me for kill player get cash/score and Commands Minigames - 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 me for kill player get cash/score and Commands Minigames (/showthread.php?tid=458336)



Help me for kill player get cash/score and Commands Minigames - egysaputra - 16.08.2013

HELP ME!!!

how if we kill the player will get a cash / score I've tried to make the script and the result does not work

and what filter script minigames?


Re: Help me for kill player get cash/score and Commands Minigames - -Prodigy- - 16.08.2013

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
        SetPlayerMoney(killerid, GetPlayerMoney(killerid) + 1000), SetPlayerScore(killerid, GetPlayerScore(killerid) + 100);
}
Give the killer 1000$ and 100 score.


Re: Help me for kill player get cash/score and Commands Minigames - egysaputra - 16.08.2013

get a random cash / score ?


Re: Help me for kill player get cash/score and Commands Minigames - -Prodigy- - 16.08.2013

For random money/score:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
        SetPlayerMoney(killerid, GetPlayerMoney(killerid) + random(5000)), SetPlayerScore(killerid, GetPlayerScore(killerid) + random(1000));
}
The killer will get random money from 0 - 5000$ and score from 0 - 1000.


Re: Help me for kill player get cash/score and Commands Minigames - egysaputra - 16.08.2013

Код:
C:\Users\Home\Downloads\Compressed\MODE SAMP\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2366) : error 021: symbol already defined: "OnPlayerDeath"
C:\Users\Home\Downloads\Compressed\MODE SAMP\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2369) : warning 209: function "OnPlayerDeath" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
why ?


Re: Help me for kill player get cash/score and Commands Minigames - Matnix - 16.08.2013

pawn Код:
return 1;
And on your script the on player death callback is already used found it.


Re: Help me for kill player get cash/score and Commands Minigames - egysaputra - 16.08.2013

not work :/ ERROR

Код:
C:\Users\Home\Downloads\Compressed\MODE SAMP\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2365) : error 021: symbol already defined: "OnPlayerDeath"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re : Re: Help me for kill player get cash/score and Commands Minigames - 1Geek - 16.08.2013

Quote:
Originally Posted by egysaputra
Посмотреть сообщение
Код:
C:\Users\Home\Downloads\Compressed\MODE SAMP\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2366) : error 021: symbol already defined: "OnPlayerDeath"
C:\Users\Home\Downloads\Compressed\MODE SAMP\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2369) : warning 209: function "OnPlayerDeath" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
why ?
Your gamemode / filtrer script already has a
pawn Код:
public OnPlayerDeath
Go to the first one and put
pawn Код:
{
    if(killerid != INVALID_PLAYER_ID)
        SetPlayerMoney(killerid, GetPlayerMoney(killerid) + random(5000)), SetPlayerScore(killerid, GetPlayerScore(killerid) + random(1000));
}
return 1;



Re : Help me for kill player get cash/score and Commands Minigames - 1Geek - 16.08.2013

And you need to delete the second
pawn Код:
public OnPlayerDeath
at the ling 2536 I mean ...


Re: Help me for kill player get cash/score and Commands Minigames - egysaputra - 16.08.2013

thanks