Zombie Sever - I have a problem with the infect system
#1

Hello all, i have a problem with my infecting system, well, i made this:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_FIRE)
	{
	    for(new i=0;i<MAX_PLAYERS;i++)
		{
		    new Float:X, Float:Y, Float:Z;
            GetPlayerPos(i, X, Y, Z);
     		if(gTeam[playerid] == Zombie)
     		{
				if(IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))
				{
				    if(gTeam[i] != Zombie)
				    {
	   					new Float:H;
	                	GetPlayerHealth(i, H);
	                	SetPlayerHealth(i, H-10);
                        SetPVarInt(playerid, "Infected", 1);
						if(GetPVarInt(playerid,"Infected") == 0)
						{
							GameTextForPlayer(i, "~r~Infected!", 500, 3);
						}
					}

				}
			}
		}
	}
	return 1;
}
And this:

Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(killerid, BLUE, "You get 100 points because you killed a RCON Admin");
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 00);
if(GetPVarInt(playerid, "Infected") == 1)
{
gTeam[playerid] = Zombie;
}
}
else
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 0);
SendClientMessage(killerid, BLUE, "You get 10 points because you killed.");
if(GetPVarInt(playerid, "Infected") == 1)
{
gTeam[playerid] = Zombie;
SetPlayerPos(playerid,-2237.0930,-2524.3779,31.4251);
SetPlayerSkin(playerid, 7;
SetPlayerWeather(playerid, 25);
SetPlayerColor(playerid, COLOR_ZOMBIE);
}
}
return 1;
}

And this... :

Quote:

public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == Zombie)
{
SetPlayerWeather(playerid, 25);
SetPlayerPos(playerid, -2176.4133,-2408.7175,35.2969);
}
else if(gTeam[playerid] == Human)
{
SetPlayerPos(playerid,-2237.0930,-2524.3779,31.4251);
}
return 1;
}

I dont know why, when i infect somebody, he spawn as human again

And i have other question, Is this ok? : Im a new at the world of scripting

Quote:

forward ActualizarLevel(playerid)
public ActualizarLevel(playerid)
{
if(GetPlayerScore(playerid) >= 50)
{
GameTextForPlayer(playerid, "~r~Level up!", 500, 3);
Rank[playerid] = 2;
}
if(GetPlayerScore(playerid) >= 100)
{
GameTextForPlayer(playerid, "~r~Level up!", 500, 3);
Rank[playerid] = 3;
}
if(GetPlayerScore(playerid) >= 150)
{
GameTextForPlayer(playerid, "~r~Level up!", 500, 3);
Rank[playerid] = 4;
}
if(GetPlayerScore(playerid) >= 200)
{
GameTextForPlayer(playerid, "~r~Level up!", 500, 3);
Rank[playerid] = 5;
}
if(GetPlayerScore(playerid) >= 300)
{
GameTextForPlayer(playerid, "~r~Level up!", 500, 3);
Rank[playerid] = 6;
}
}

The message about "Level up" didnt apear


Plz dont post coments like: Solve your problems by yourself, blabla, thanks for help, and see ya

Pd: sorry about the order of the script, im new using the "Quote" buttom, Im using ****** translator
Reply
#2

Use [pawn] [/pawn ] Without the space between "n" and "]"
Reply
#3

1: Thanks telling me about use [PAWN] ...
2: I made this:

#define Human 0
#define Zombie 1

3: I know about the Tab option, but when i copyed that from my pawn file, it had diferent order, anyway thanks for help

Somebody know why when the infected player die, he didnt become a zombie?
Reply
#4

Solved ^^
the error was here:
pawn Код:
SetPVarInt(playerid, "Infected", 1)
if(GetPVarInt(playerid,"Infected") == 0)
I needed to replace ''playerid'' to ''i''
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)