#1

I get this error, and these warnings when I compile the script ( Ravens Roleplay (LARP) )

C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(25115) : error 021: symbol already defined: "strtok"
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53561) : warning 217: loose indentation
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53565) : warning 217: loose indentation
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(5356 : warning 217: loose indentation
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53572) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

The code where I get the error:

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;
}
And the warnings:

pawn Код:
//------------------------------[Flip]-----------------------------------------------------------
    if(strcmp(cmd, "/flip", true) == 0)
 {
     if(PlayerInfo[playerid][pAdmin] >= 3)
     {
         if(IsPlayerInAnyVehicle(playerid))
         {
             new Float:PX, Float:PY, Float:PZ, Float:PA;
    GetPlayerPos(playerid, PX, PY, PZ);
    GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
    SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
             SendClientMessage(playerid, COLOR_GREEN," Vehicle Succesfully Flipped!");
   }
  }
  else
  {
   SendClientMessage(playerid, COLOR_GRAD1, " You Are Not An Admin Level 3!");
  }
  return 1;
 }
Reply
#2

For the strtok errors, Search for strtok in your Script as you may already have it defined.
Reply
#3

@Luis So I just copy "strtok(const string[], &index)" and find next in the script?
- Because when I do that I only find that one..
Reply
#4

Place that on the top of your script
Код:
#pragma unused strtok
#pragma tabsize 0
Reply
#5

@XoX I've putted on top of my script, but I still get the error. :S

Anyways the line that the error comes on is at the first {
Reply
#6

show us the includes
Reply
#7

Quote:
Originally Posted by xemper
Посмотреть сообщение
@XoX I've putted on top of my script, but I still get the error. :S

Anyways the line that the error comes on is at the first {
Erase this code and compile:

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;
}
I hope that i have helped
Reply
#8

@rjjj Thank you! It worked!

Anyway I need help to a new thing... :/ It's a gate that i wanna make moveable, and I get this warning:

C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(6942) : warning 202: number of arguments does not match definition

And here's the code:
pawn Код:
public GateClose6()
{
      MoveDynamicObject(bcgate1, 1005.15850830,-2092.55249023,14.94963074, 1,5);
      return 1;
}
Hope somebody wanna correct me
Reply
#9

Quote:
Originally Posted by xemper
Посмотреть сообщение
@rjjj Thank you! It worked!

Anyway I need help to a new thing... :/ It's a gate that i wanna make moveable, and I get this warning:

C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(6942) : warning 202: number of arguments does not match definition

And here's the code:
pawn Код:
public GateClose6()
{
      MoveDynamicObject(bcgate1, 1005.15850830,-2092.55249023,14.94963074, 1,5);
      return 1;
}
Hope somebody wanna correct me
Sure


Change this:

pawn Код:
MoveDynamicObject(bcgate1, 1005.15850830,-2092.55249023,14.94963074 ,1,5);
for:

pawn Код:
MoveDynamicObject(bcgate1, 1005.15850830,-2092.55249023,14.94963074,3);
And compile.

I hope that i have helped
Reply
#10

Код:
public GateClose6()
{
      MoveDynamicObject(bcgate1, 1005.15850830,-2092.55249023, 1,5);
      return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)