Need help with errors
#1

I'm making a system were if someone has a curtain amount of kills, they get curtain weapons, but I'm getting errors which I need help with.

The script is this:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][Kills] == 0)
    {
    GivePlayerWeapon(playerid,24,3000);
    }
    if(PlayerInfo[playerid][Kills] == 50)
    {
    GivePlayerWeapon(playerid,24,3000);
    GivePlayerWeapon(playerid,25,3000);
    }
   
    SetPlayerToTeamColor(playerid);
    return 1;
}
The errors:

pawn Код:
C:\Users\Johnny\Desktop\Urban TDM\gamemodes\UTDM.pwn(324) : error 017: undefined symbol "PlayerInfo"
C:\Users\Johnny\Desktop\Urban TDM\gamemodes\UTDM.pwn(324) : warning 215: expression has no effect
C:\Users\Johnny\Desktop\Urban TDM\gamemodes\UTDM.pwn(324) : error 001: expected token: ";", but found "]"
C:\Users\Johnny\Desktop\Urban TDM\gamemodes\UTDM.pwn(324) : error 029: invalid expression, assumed zero
C:\Users\Johnny\Desktop\Urban TDM\gamemodes\UTDM.pwn(324) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Line 324 is the bold one:

Quote:

public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][Kills] == 0)
{
GivePlayerWeapon(playerid,24,3000);
}
if(PlayerInfo[playerid][Kills] == 50)
{
GivePlayerWeapon(playerid,24,3000);
GivePlayerWeapon(playerid,25,3000);
}

SetPlayerToTeamColor(playerid);
return 1;
}

Reply
#2

did you add this??
pawn Код:
enum pData
{
  Kills,
};
New PlayerInfo[MAX_PLAYERS][pData];
Reply
#3

Or you can just scrap the whole 0.2 way of doing it and use Per-Player Variables (PVars).

pawn Код:
if(GetPVarInt(playerid,"Kills") == 50)
Reply
#4

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
Or you can just scrap the whole 0.2 way of doing it and use Per-Player Variables (PVars).

pawn Код:
if(GetPVarInt(playerid,"Kills") == 50)
You always save me
Reply
#5

-Sorry for double post-

Ok so I've done everything as far as the weapons etc go but I use LAdmin Filterscript and I went into my userfile and made my kills 650.
But still spawn with a Deagle (The 0 kill weapon)
So I went into my LAdmin script and put the code there (still under OnPlayerSpawn) but still, only spawn with the Deagle.
Anyone know why?
Reply
#6

Are you sure your player saving method works?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)