Scripting Error
#1

C:\Users\Mike\Desktop\Server\gamemodes\PTPM.pwn(29 : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Mike\Desktop\Server\gamemodes\PTPM.pwn(29 : warning 215: expression has no effect

Код:
 }
    SetCameraBehindPlayer(playerid);
    return 1;
    }

C:\Users\Mike\Desktop\Server\gamemodes\PTPM.pwn(77 : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Код:
{
	new i, li;
	new aNum;
	new len;
	while(i <= strlen(strsrc)){
	  if(strsrc[i]==delimiter || i==strlen(strsrc)){
	    len = strmid(strdest[aNum], strsrc, li, i, 128);
	    strdest[aNum][len] = 0;
	    li = i+1;
	    aNum++;
		}
		i++;
	}
	return 1;
777	} // Script Ends Here
778
1 Error.
Reply
#2

At the last error Try add this: "#pragma unused strtok" at the top.

Or else try this:


pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#3

Show the whole code for the first error.
Reply
#4

Quote:
Originally Posted by Benne
At the last error Try add this: "#pragma unused strtok" at the top.

Or else try this:


pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
The first one dosen't works
The second one I dont know where to put it...
Reply
#5

Quote:
Originally Posted by MadeMan
Show the whole code for the first error.
Код:
case Hitman:
   	{
      SetPlayerPos(playerid, -2721.3049,-317.2299,7.8438);
      SetPlayerFacingAngle(playerid, 45.857);
      SetPlayerColor(playerid, TEAMCOLOR_VPM);

    }
    SetCameraBehindPlayer (playerid);
    return 1;
Reply
#6

close the switch before you set camera. or else put the camera setting in the brackets.
Reply
#7

Quote:
Originally Posted by Daren_Jacobson
close the switch before you set camera. or else put the camera setting in the brackets.
I'm a noob scripter, how it would be?
Reply
#8

pawn Код:
switch(spawntype) //should be different for your script
{
  case Hitman:
  {
    SetPlayerPos(playerid, -2721.3049,-317.2299,7.8438);
    SetPlayerFacingAngle(playerid, 45.857);
    SetPlayerColor(playerid, TEAMCOLOR_VPM);
  }
}
SetCameraBehindPlayer (playerid);
return 1;
Reply
#9

Код:
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(293) : warning 217: loose indentation
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(294) : error 014: invalid statement; not in switch
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(294) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(294) : error 001: expected token: ";", but found ":"
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(294) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\Server\gamemodes\PTPM.pwn(294) : fatal error 107: too many error messages on one line

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


5 Errors.
It looks like this


Код:
{
     case HITMAN:
  {
    SetPlayerPos(playerid, -2721.3049,-317.2299,7.8438);
    SetPlayerFacingAngle(playerid, 45.857);
    SetPlayerColor(playerid, TEAMCOLOR_VPM);
  }
}
SetCameraBehindPlayer (playerid);
return 1;
Reply
#10

Show the whole callback (I guess it's OnPlayerSpawn).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)