SA-MP Forums Archive
[HELP] if one player dies, lose 5000$ - 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] if one player dies, lose 5000$ (/showthread.php?tid=115133)



[HELP] if one player dies, lose 5000$ - akis_tze - 22.12.2009

It is possible to do only one player with the name Sas_Tsakisa, if dies lose 5000$

Only this player lose 5000$ the other players Excluded

if anyone know how, please to tell me


Re: [HELP] if one player dies, lose 5000$ - Niixie - 22.12.2009

OnPlayerDeath
pawn Код:
OnPlayerDeath //Full callback
{
    GivePlayerMoney(playerid, -5000);
    return 1;
}
UNTESTED

Should work


Re: [HELP] if one player dies, lose 5000$ - FireFox_ - 22.12.2009

I think he means if a player with a centrain name dies he loses 5000





Re: [HELP] if one player dies, lose 5000$ - akis_tze - 22.12.2009

yes that i mean, a player with a centrain name dies he loses 5000


Re: [HELP] if one player dies, lose 5000$ - s0nic - 22.12.2009

This is a method that i would use..should work:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new name[24];
    GetPlayerName(playerid,name,sizeof(name));
    if(strcmp(name,"Sas_Tsakisa",true) == 0)//add more by adding " || strcmp(name,"name",true) == 0" inside the last ")"
    {
        GivePlayerMoney(playerid, -5000);
    }
    return 1;
}



Re: [HELP] if one player dies, lose 5000$ - Striker_Moe - 22.12.2009

pawn Код:
public OnPlayerDeath(playerid,reason)
{
    new name[24]:
    GetPlayerName(playerid, name, sizeof(name));
    if(!strcmp(name,"Sas_Tsakisa",false))
    {
    GivePlayerMoney(playerid,-5000);
    }
    return 1;
}



Re: [HELP] if one player dies, lose 5000$ - Doppeyy - 22.12.2009

Quote:
Originally Posted by Mo3
pawn Код:
public OnPlayerDeath(playerid,reason)
{
    new name[24]:
    GetPlayerName(playerid, name, sizeof(name));
    if(!strcmp(name,"Sas_Tsakisa",false))
    {
    GivePlayerMoney(playerid,-5000);
    }
    return 1;
}
Why did you post exactly the same thing as the guy above you ?

/Artix


Re: [HELP] if one player dies, lose 5000$ - s0nic - 22.12.2009

All he did is modify the name checking line...there's different methods for that.


Re: [HELP] if one player dies, lose 5000$ - Deat_Itself - 22.12.2009


pawn Код:
GivePlayerMoney(playerid,-5000);//use this ,it may help you
    GivePlayerMoney(killerid,+5000); //put this both in onplayerdeath



Re: [HELP] if one player dies, lose 5000$ - Zamaroht - 22.12.2009

Quote:
Originally Posted by _Saif_
pawn Код:
GivePlayerMoney(playerid,-5000);//use this ,it may help you
    GivePlayerMoney(killerid,+5000); //put this both in onplayerdeath
Did you even read what he asked for?