How can this be wrong?
#1

hi, in my GM I got lots of timers, and stuff, and I work alot with them, now I made a FS 'cuz i'm working on a project wich I will release here...

I did everything as in my GM with my timers, but I get errors....


Код:
C:\Users\William\Downloads\Ti+Stuntacular\filterscripts\D-day_TDM.pwn(99) : warning 217: loose indentation
C:\Users\William\Downloads\Ti+Stuntacular\filterscripts\D-day_TDM.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\William\Downloads\Ti+Stuntacular\filterscripts\D-day_TDM.pwn(99) : error 004: function "ddayjoin" is not implemented
C:\Users\William\Downloads\Ti+Stuntacular\filterscripts\D-day_TDM.pwn(100) : warning 217: loose indentation
C:\Users\William\Downloads\Ti+Stuntacular\filterscripts\D-day_TDM.pwn(103) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <streamer>
#include <XStreamer>
#include <colorHandler>
#include <TextDrawCountDown>


#define COLOR_GREEN 0x008000FF
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_LIGHTBLUE 0x00BFFFFF
#define COLOR_PINK 0xFF80C0FF
#define FILTERSCRIPT

forward ddayjoin();

new ddaystarts[MAX_PLAYERS];//function to see if d-day is started yet

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" D-day Team DeathMatch");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
public OnGameModeInit()
{
   SetTimer("ddayjoin", 1200000, true); //This makes that every time when a new dday starts (every 15 minuts) we will get a textdraw
   return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    ddaystarts[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/dday", cmdtext, true) == 0)
   {
      if(ddaystarts[playerid] == 1)
      {
      ddaystarts[playerid] = 0;
   }
}

public ddayjoin()//line 99
  {
    ddaystarts[playerid] = 1;
  }
return 0;
}

It's weird , because I did exactly what is nescesairy...

NOTE: I'm still in the beginning of my project...
Reply
#2

pawn Код:
foreach(Player, i)
{
    ddaystarts[i] = 1;
}
You will need to loop, + i recommend using foreach
Reply
#3

The problem lies at the end of your code:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/dday", cmdtext, true) == 0)
   {
      if(ddaystarts[playerid] == 1)
      {
          ddaystarts[playerid] = 0;
      }
      return 1;
   }
   return 0;
}

public ddayjoin()//line 99
{
    ddaystarts[playerid] = 1;
    return 1;
}
You were missing a few returns and a few brackets. Also you need to remember that playerid isn't defined in that local scope, I assume you want it to be done for everyone, therefore you need to use a loop like the person above suggested.

Although if you do not know about foreach, then here is an example using the general for loop.

pawn Код:
public ddayjoin()//line 99
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        ddaystarts[i] = 1;
    }
    return 1;
}
Although again I wonder why you bother having it separate for each player, considering it seems all players will always have it set to the same according to your script.
Reply
#4

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
The problem lies at the end of your code:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/dday", cmdtext, true) == 0)
   {
      if(ddaystarts[playerid] == 1)
      {
          ddaystarts[playerid] = 0;
      }
      return 1;
   }
   return 0;
}

public ddayjoin()//line 99
{
    ddaystarts[playerid] = 1;
    return 1;
}
You were missing a few returns and a few brackets. Also you need to remember that playerid isn't defined in that local scope, I assume you want it to be done for everyone, therefore you need to use a loop like the person above suggested.

Although if you do not know about foreach, then here is an example using the general for loop.

pawn Код:
public ddayjoin()//line 99
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        ddaystarts[i] = 1;
    }
    return 1;
}
Although again I wonder why you bother having it separate for each player, considering it seems all players will always have it set to the same according to your script.
Thanks alot!
but somehow it's weird, because in my GM I don't do it like the way you showed, and there it does work...
Reply
#5

And, if you don't want to get any "loose indentation"- warnings, use this:

pawn Код:
#pragma tabsize 0
You can also fix them, but I think it's annoying
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)