[HELP] if one player dies, lose 5000$
#1

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

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

Should work
Reply
#3

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


Reply
#4

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

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;
}
Reply
#6

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

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

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


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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)