SA-MP Forums Archive
[HELP] Duel System - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Duel System (/showthread.php?tid=178315)



[HELP] Duel System - NotoriousMOB - 21.09.2010

Can anyone tell me what i need to add to my Duel script or edit in GM
so when a player wins he doesen't lose 1000$ because he get's wanted for killing in duel.






Re: [HELP] Duel System - dirkblok - 21.09.2010

Look for OnPlayerDeath
And do GivePlayerMoney to the killerid.

Hope this helped you. otherwise i'll make the code.

This forum requires that you wait 120 seconds between posts. Please try again in 43 seconds.


Re: [HELP] Duel System - Rachael - 21.09.2010

I would suggest looking in OnPlayerDeath for the code that takes away the cash for dying with a wanted level, and put
pawn Код:
if(duel[playerid]) // insert the variable you use to keep track of who is fueling
{
    SetPlayerWantedLevel(playerid,0); // or whatever system you are using
    return 1; //this will stop the callback here
}
just before it.


Re: [HELP] Duel System - NotoriousMOB - 21.09.2010

There's 4 scripts for the Dual Room's under OnPlayerDeath

if(DualRoom2 == playerid || DualRoom1 == killerid)
if(DualRoom2 == playerid || DualRoom1 == killerid)
if(DualRoom3 == playerid || DualRoom1 == killerid)
if(DualRoom4 == playerid || DualRoom1 == killerid)

They have all 4 have GivePlayerMoney(killerid, (DualRoom4price*2));


Re: [HELP] Duel System - NotoriousMOB - 21.09.2010

Oh damn you mean in GameMode, i try this out Rachael.


Re: [HELP] Duel System - NotoriousMOB - 21.09.2010

Maybe the GiveMoney one is more simpel cause i can't get that other one to work
can you tell me how to make the code?


Re: [HELP] Duel System - dirkblok - 21.09.2010

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GivePlayerMoney(killerid, 1000);
    return 1;
}



Re: [HELP] Duel System - NotoriousMOB - 21.09.2010

Well okay now when i enter the duel and win it i don't loose the 1000
but.. im still in the duel area.

maybe because i got this message:

C:\Users\Noto\Desktop\Real Server\filterscripts\NTDuel.pwn(192) : warning 217: loose indentation


Re: [HELP] Duel System - Mike_Peterson - 21.09.2010

thats simple, just make/remove some spaces/tabs
or just use #pragma unused tabs


Re: [HELP] Duel System - NotoriousMOB - 21.09.2010

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(InDual[playerid] == 1)
         {
        GivePlayerMoney(killerid, 1000);
        return 1;
        }
        new string[256];  // its telling me this is the problem
        new killername[MAX_PLAYER_NAME];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(killerid, killername, sizeof(killername));
        GetPlayerName(playerid, playername, sizeof(playername));
        if(DualRoom1 == playerid || DualRoom1 == killerid)
        {
Tried to space and stuff still non.