Teams script error (help = rep)
#1

It's giving me these errors;

Q:\Samp Server\gamemodes\jefferson.pwn(118...) error 037: invalid string (possibly non-terminated string)
Q:\Samp Server\gamemodes\jefferson.pwn(118...) warning 215: expression has no effect
Q:\Samp Server\gamemodes\jefferson.pwn(118...) error 001: expected token: ";", but found ")"
Q:\Samp Server\gamemodes\jefferson.pwn(118...) error 029: invalid expression, assumed zero
Q:\Samp Server\gamemodes\jefferson.pwn(118...) fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here is the script;
#define TEAM_DEFENDERS 1
#define TEAM_ATTACKERS 2

AddPlayerClass(285,2231.7539,-1179.4497,29.8044,45.1304,0,0,0,0,0,0); // Defenders Spawn
AddPlayerClass(179,2207.5635,-1101.0859,31.5547,123.7775,0,0,0,0,0,0); // Attackers Spawn

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 2217.3853,-1149.1981,25.7647);
SetPlayerFacingAngle(playerid, 357.9850);
SetPlayerCameraPos(playerid, 2217.3264,-1144.1943,25.7955);
SetPlayerCameraLookAt(playerid, 2217.3853,-1149.1981,25.7647);
switch(classid)
{
case 1:
{
SetPlayerTeam(playerid,TEAM_DEFENDERS);
GameTextForPlayer(playerid,"~b~DEFENDER",5000,3");
return 1;
}
case 2:
{
SetPlayerTeam(playerid,TEAM_ATTACKERS);
GametextForPlayer(playerid,"~b~ATTACKER",5000,3");
return1;
}
}
return 1;
}
Reply
#2

which one is the line 118?
Reply
#3

Where are the lines exactly ?

And please use
pawn Код:
CODE HERE
Reply
#4

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 2217.3853,-1149.1981,25.7647);
    SetPlayerFacingAngle(playerid, 357.9850);
    SetPlayerCameraPos(playerid, 2217.3264,-1144.1943,25.7955);
    SetPlayerCameraLookAt(playerid, 2217.3853,-1149.1981,25.7647);

    switch(classid)
    {
        case 1:
        {
        SetPlayerTeam(playerid,TEAM_DEFENDERS);
        GameTextForPlayer(playerid, "~b~DEFENDER", 5000, 3);
        }
        case 2:
        {
        SetPlayerTeam(playerid,TEAM_ATTACKERS);
        GameTextForPlayer(playerid, "~b~ATTACKER", 5000, 3);
        }
    }
    return 1;
}
Reply
#5

Thanks you it now has 2 out of 4 errors and these are;
Q:\Samp Server\gamemodes\jefferson.pwn(120) : error 017: undefined symbol "TEAM_DEFENDERS"
Q:\Samp Server\gamemodes\jefferson.pwn(125) : error 017: undefined symbol "TEAM_ATTACKERS"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

The only problem is that I've defined it but I still have 2 other errors
The code I used is this;
pawn Code:
#define TEAM_DEFENDERS
#define TEAM_ATTACKERS
Reply
#6

Could you please stop using [+REP] on the title?

btw,

Try this:
Quote:

#define TEAM_DEFENDERS 0
#define TEAM_ATTACKERS 1

Or this:
Quote:

#define TEAM_DEFENDERS 1
#define TEAM_ATTACKERS 2

Reply
#7

I've tried both and it's not working and for the rep well as long as its gonna work I'll rep the person who helped me so its not pointless or fake
Reply
#8

as Gogorakis said use second option then try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)