I need some help finding the reasons for the errors I am getting.
#1

I just recently started looking into scripting and I honestly have no experience with any type of coding at all. Anyways I found some tuts to get me started with basic scripting in the pawno file but seem to be getting a few errors when I attempt to compile it and I can't figure out what is causing them, the error numbers are 001, 010, and I am getting warning 217 and warning 203..If anyone could take a few minutes to hop on team viewer I'd appreciate it.

Quote:

C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(64) : warning 217: loose indentation
C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(64) : error 001: expected token: ",", but found ";"
C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(6 : warning 217: loose indentation
C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(93) : error 010: invalid function or declaration
C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(95) : error 010: invalid function or declaration
C:\Users\Chris\Desktop\SAMP\gamemodes\tut.pwn(11 : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

pawn Код:
///included
#include <a_samp>
#include <dini>
#include <dutils>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA

#define PlayerFile         "AdminScript/Users/%s.ini"
#define SettingFile            "AdminScript/Settings/MainSettings.ini"
#define CommandFile            "AdminScript/Settings/Commands.ini"

///Defines
#define COLOR_RED 0xAA3333AA

main()
{

}

public OnFilterScriptInit()
    {
    print("\n****************************************");
    print("* Admin Filterscript by Adam_Cipriani *");
    print("****************************************\n");
    return 1;
    }

    #endif

enum PLAYER_MAIN {
    PLAYER_NAME[MAX_PLAYER_NAME],
    PLAYER_IP[16],
    PLAYER_REGGED,
    PLAYER_PASS,
    PLAYER_LOGGED,
    PLAYER_LEVEL,
    PLAYER_WIRED,
    PLAYER_JAILED
}
new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];

public OnGameModeInit()
{
    print("The Game Mod Was Initiated!");
    return 1;
}

public OnGameModeExit()
{
    print("The Game Mode Was Exited");
    return 1;
}

public OnPlayerConnect(playerid)
{

    new file[100],Name[MAX_PLAYER_NAME],Ip[16];
        GetPlayerName(playerid,Name,sizeof(Name);
        GetPlayerIp(playerid,Ip,sizeof(Ip));
        format(file,sizeof(file),PlayerFile,Name);

    if(!dini_Exists(file))
        {
         dini_Create(file);
         dini_Set(file,"Name",Name);
         dini_Set(file,"Ip",Ip);
         dini_IntSet(file,"Registered",-1);
         dini_IntSet(file,"Password",0);
         dini_IntSet(file,"Level",0);
         dini_IntSet(file,"Wired",0);
         dini_IntSet(file,"Jailed",0);
         SendClientMessage(playerid,COLOUR_ORANGE,"Your username is not recognized on this server. Please /register to continue.");
    }
    strcat(gPlayerInfo[playerid][PLAYER_NAME],            dini_Get(file,"Name"));
    strcat(gPlayerInfo[playerid][PLAYER_IP],              dini_Get(file,"Ip"));
    gPlayerInfo[playerid][PLAYER_REGGED]                  = dini_Int(file,"Registered");
    gPlayerInfo[playerid][PLAYER_PASS]                    = dini_Int(file,"Password");
    gPlayerInfo[playerid][PLAYER_LEVEL]                   = dini_Int(file,"Level");
    gPlayerInfo[playerid][PLAYER_WIRED]                   = dini_Int(file,"Wired");
    gPlayerInfo[playerid][PLAYER_JAILED]                  = dini_Int(file,"Jailed");
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)           SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)      SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
    gPlayerInfo[playerid][PLAYER_REGGED]                  = 0;
    return 1;
}

if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
    SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    return 1;

public OnPlayerDisconnect(playerid, reason)
{
    SendClientMessage(playerid, COLOR_RED, "GoodBye!");
    SendClientMessageToAll(COLOR_RED, "A Player Left The Server!");
    return 1;
}

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

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

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

show errors in [ quote ] and [ /quote ] and the PWN lines using [ Pawn ] [ /pawn ]
We'll help when...
Reply
#3

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
show errors in [ quote ] and [ /quote ] and the PWN lines using [ Pawn ] [ /pawn ]
We'll help when...
Okay I fixed it, I really hope some one can figure it out lol....
Reply
#4

pawn Код:
//Find
GetPlayerName(playerid,Name,sizeof(Name);
//Change to
GetPlayerName(playerid,Name,sizeof(Name));

//Code outside function due to closed brace
if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
    SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    return 1;
Fix intendation (search for it)
Reply
#5

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
//Find
GetPlayerName(playerid,Name,sizeof(Name);
//Change to
GetPlayerName(playerid,Name,sizeof(Name));

//Code outside function due to closed brace
if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
    SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
    return 1;
Fix intendation (search for it)
What am I exactly supposed to do with
pawn Код:
if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
return 1;
? Just fixed the other issues but I am not fully understanding this problem..
Reply
#6

at the top of your script

pawn Код:
#pragma unused ret_memcpy
pawn Код:
if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
{
SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
return 1;
}
Reply
#7

Quote:
Originally Posted by Domnic Toretto
Посмотреть сообщение
at the top of your script

pawn Код:
#pragma unused ret_memcpy
pawn Код:
if(gPlayerInfo[playerid][PLAYER_REGGED] == 0)
{
SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
return 1;
}
That didnt do anything, still getting the 010 error for that one script. Dx
Reply
#8

Could some one just hop on Team viewer? It would only take a few seconds as I am sure it's something very small, just no matter how many times I look at it I can't seem to figure out the cause
Reply
#9

Well I have fixed the last issue, just needed to be patient and read through everything lol >< anyways I am working on the registration and have come across a new error which according to my research on ****** others have had the same issue but nothing was found for it. So I was wondering if some one could help me with the pawno posted below, I will also place the error up as well
Quote:

C:\Users\Chris\Desktop\SAMP\gamemodes\pirate.pwn(9 9) : error 017: undefined symbol "dcmd_login"
C:\Users\Chris\Desktop\SAMP\gamemodes\pirate.pwn(1 00) : error 017: undefined symbol "dcmd_logout"
C:\Users\Chris\Desktop\SAMP\gamemodes\pirate.pwn(1 01) : error 017: undefined symbol "dcmd_password"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(register, 8, cmdtext);
dcmd(login, 5, cmdtext);
dcmd(logout, 6, cmdtext);
dcmd(password , 8, cmdtext);
return 0;

}
Reply
#10

Do you have functions dcmd_(register/login/logout/password) present? Looks like register is present, while other are not.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)