Fishing
#1

I'm trying to create a fishing system, but i get errors, and i've barely started.
Код:
#include <a_samp>

#if defined FILTERSCRIPT

#include <a_samp>
#include <ZCMD>
#include <sscanf2>

new HasRod[MAX_PLAYERS], HasBait[MAX_PLAYERS], Fishing[MAX_PLAYERS], Fish[MAX_PLAYERS][5];

#define WHITE 0xFFFFFFAA
#define RED 0xAA3333AA

forward FishCatchTimer(playerid);

#endif

public OnPlayerConnect(playerid)
{
    Fishing[playerid] = 0;
    HasBait[playerid] = 0;
    HasRod[playerid] = 0;
    Fish[playerid][1] = 0;
    Fish[playerid][2] = 0;
    Fish[playerid][3] = 0;
    Fish[playerid][4] = 0;
    return 1;
}
errors:
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Fishing.pwn(20) : error 017: undefined symbol "Fishing"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Fishing.pwn(20) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Fishing.pwn(20) : error 001: expected token: ";", but found "]"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Fishing.pwn(20) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Fishing.pwn(20) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

Try this:

PHP код:
#include <a_samp>
#if defined FILTERSCRIPT
#include <a_samp>
#include <ZCMD>
#include <sscanf2>
#define WHITE 0xFFFFFFAA
#define RED 0xAA3333AA
forward FishCatchTimer(playerid);
#endif
new HasRod[MAX_PLAYERS], HasBait[MAX_PLAYERS], Fishing[MAX_PLAYERS], Fish[MAX_PLAYERS][5];
public 
OnPlayerConnect(playerid)
{
    
Fishing[playerid] = 0;
    
HasBait[playerid] = 0;
    
HasRod[playerid] = 0;
    
Fish[playerid][1] = 0;
    
Fish[playerid][2] = 0;
    
Fish[playerid][3] = 0;
    
Fish[playerid][4] = 0;
    return 
1;

Reply
#3

Worked thanks, +rep.
Reply
#4

Plovix's solution is not a solution. You have to realize what was the actual problem. It was you having the variables defined in a false condition, between #if defined FILTERSCRIPT and #endif. You have nowhere defined that it's a filterscript. There are two solutions - because now the forwards/defines you made won't work either.

Either delete the "#if defined FILTERSCRIPT" and "#endif" lines or put "#define FILTERSCRIPT" at the very beginning of your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)