Whats wrong?
#1

After when someone dies and spawns, they lose 100 dollars. I tryed many things but it wont be fixed D:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsSpecing[playerid] == 1)
    {
        SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
        SetPlayerInterior(playerid,Inter[playerid]);
        SetPlayerVirtualWorld(playerid,vWorld[playerid]);
        IsSpecing[playerid] = 0;
        IsBeingSpeced[spectatorid[playerid]] = 0;
    }
    new filo[256];
    format(filo,256,"org%d.ini",PlayerInfo[playerid][Member]);
    SetPlayerColor(playerid,HexToInt(dini_Get(filo,"Color")));
    GivePlayerWeapon(playerid,dini_Int(filo,"Wep1"),5000);
    GivePlayerWeapon(playerid,dini_Int(filo,"Wep2"),5000);
    GivePlayerWeapon(playerid,dini_Int(filo,"Wep3"),5000);
    if(PlayerInfo[playerid][Member] == -255)
    {
        SetPlayerColor(playerid,0xFFFFFFFF);
    }
    if(god[playerid] == 1)
    {
    SetPlayerHealth(playerid,100000);
    }
    spawned[playerid] = 1;
    SetPlayerPos(playerid,PlayerData[playerid][PosX],PlayerData[playerid][PosY],PlayerData[playerid][PosZ]+1);
    if(useskin[playerid] == 1) return SetPlayerSkin(playerid,PlayerData[playerid][Saveskin]);
    if(justconnected[playerid] == 1)
    {
        if(PlayerData[playerid][PosX] == 0 && PlayerData[playerid][PosY] == 0 && PlayerData[playerid][PosZ] == 0)
        {
            SetPlayerPos(playerid,1705.6431,1452.7920,10.8170);
            SetPlayerFacingAngle(playerid,268.1469);
            SetCameraBehindPlayer(playerid);
        }
    }
    format(str,sizeof(str),"You have $%d money in your wallet",GetPlayerMoney(playerid));
    SendClientMessage(playerid,0x0080C0FF,str);
    return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsBeingSpeced[playerid] == 1)
    {
        foreach(Player,i)
        {
            if(spectatorid[i] == playerid)
            {
                TogglePlayerSpectating(i,false);
            }
        }
    }
    spawned[playerid] = 0;
    GetPlayerPos(killerid,X,Y,Z);
    GetPlayerName(playerid,Nam,sizeof(Nam));
    GetPlayerName(killerid,pname, sizeof(pname));
    GetWeaponName(reason,WeapName,32);
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,10,X,Y,Z))
        {
            format(str,sizeof(str),"%s has been killed by %s. Weapon: %s",Nam,pname,WeapName);
            SendClientMessage(i,orange,str);
        }
    }
    return 1;
}
Reply
#2

Do you have another spawn function in your gamemode if so look for all the spawn functions like publics and i know this is not part of the question but why is there a -255 isn't it supposed to be
pawn Код:
if(PlayerInfo[playerid][Member] == 255)
{
        SetPlayerColor(playerid,0xFFFFFFFF);
    }
instead of
pawn Код:
if(PlayerInfo[playerid][Member] == -255)
    {
        SetPlayerColor(playerid,0xFFFFFFFF);
    }
Reply
#3

Quote:
Originally Posted by Lilcuete
Посмотреть сообщение
Do you have another spawn function in your gamemode if so look for all the spawn functions like publics and i know this is not part of the question but why is there a -255 isn't it supposed to be
pawn Код:
if(PlayerInfo[playerid][Member] == 255)
{
        SetPlayerColor(playerid,0xFFFFFFFF);
    }
instead of
pawn Код:
if(PlayerInfo[playerid][Member] == -255)
    {
        SetPlayerColor(playerid,0xFFFFFFFF);
    }
Yeah any other Deah or Spawn function's your using??

Search for GivePlayerCash or SetPlayerCash function's in your GM. If it's reducing 100 $ then delete it!
Reply
#4

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Search for GivePlayerCash or SetPlayerCash !
or mb GivePlayerMoney & SetPlayerMoney?!
Reply
#5

i dont have any giveplayercash -100 or giveplayermoney - 100 and Lilcutee. That is not causing the bug because that is one of my organization file.
Reply
#6

You have another function interfering with it. Maybe one of you custom functions is causing this problem. You have to specify if he loses money on spawn or on death.
Reply
#7

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
You have another function interfering with it. Maybe one of you custom functions is causing this problem. You have to specify if he loses money on spawn or on death.
Right. So re check your code again for any Interfering between these function's. Are you using any FS??
Reply
#8

I thought this was actually a known bug. It's not a script bug if my memory is serving me correctly. I've had this problem a few times before, but never seemed to be able to fix it. Maybe just use a server-side money system so even if it does take the money it resets it.
Reply
#9

Or maybe give player 100$ after death.
Reply
#10

No that's correct, sometimes a player will either get or lose $100 on death.
I've had to make my anticheat detect amounts only over 100 because of the exact same issue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)