-1000 when dying, can't go below 1000, why does this not work?
#1

Код:
public OnPlayerSpawn(playerid)
{
	if (CheckDeathOnGodMode[playerid] == 1)
	{
		SetPlayerPos(playerid, xGodmode, yGodmode, zGodmode);
		CheckDeathOnGodMode[playerid] = 0;
	}
	/*if (IsLoggedIn[playerid] == 0)
	{
	    ForceClassSelection(playerid);
    	TogglePlayerSpectating(playerid, true);
    	TogglePlayerSpectating(playerid, false);
    }*/
    else
	{
    	SetPlayerInterior(playerid,0);
    	for(new i=0; i < sizeof(ZoneInfo); i++)
		{
    		GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
		}
		SetPlayerToTeamColor(playerid);
  		if (PlayerInfo[playerid][pCash] < 1000)
  		{
    		        PlayerInfo[playerid][pCash] = 1000;
			ResetPlayerMoney(playerid);
			GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
		}
		else
		{
			ResetPlayerMoney(playerid);
			GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
		}
	}
	return 1;
}
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	if (GodMode[playerid] == 1)
	{
	    GetPlayerPos(playerid, xGodmode, yGodmode, zGodmode);
	    //SetTimerEx("GodmodeDelay", 2750, false, "i", playerid);
	    CheckDeathOnGodMode[playerid] = 1;
	}
        else
        {
             PlayerInfo[killerid][pKills]++;
    	     PlayerInfo[killerid][pCash] = (PlayerInfo[killerid][pCash] + 1000);
    	     GivePlayerMoney(killerid, 1000);
    	     PlayerInfo[playerid][pDeaths]++;
    	     if (PlayerInfo[playerid][pCash] < 2000)
    	     {
	          PlayerInfo[playerid][pCash] = 1000;
	     }
	     else
	     {
                  PlayerInfo[playerid][pCash] = (PlayerInfo[playerid][pCash] - 1000);
              }
	}
        return 1;
}
Why does this not work?

If the player dies with 5000, he spawns with 5000, whilst it's supposed to go down to 4000... Not sure what I did wrong?
Reply


Messages In This Thread
-1000 when dying, can't go below 1000, why does this not work? - by AnthonyTimmers - 15.02.2014, 12:36
Re: -1000 when dying, can't go below 1000, why does this not work? - by AnthonyTimmers - 15.02.2014, 12:50
Re: -1000 when dying, can't go below 1000, why does this not work? - by AnthonyTimmers - 15.02.2014, 14:14
Re: -1000 when dying, can't go below 1000, why does this not work? - by AnthonyTimmers - 15.02.2014, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)