[HELP] Duel System
#1

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.



Reply
#2

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.
Reply
#3

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.
Reply
#4

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));
Reply
#5

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)