fly mod - satdm
#1

Hi, i have a little problem.
I have started my own server and downloaded some fs. Everything was working especially the fs "fly" as i downloaded. I made some changes in it and now i cant compile. What is the problem and can i change it so i get it to vip lvl 3 only. the compile msg is: ...\fly.pwn(5 : warning 203: symbol is never used: "strtok"

the code in the script is:
Quote:

#define FILTERSCRIPT
#include <a_samp>
#include <fly>
#include <ladmin>

public OnFilterScriptInit()
{
print("=========================================\n ");
print("Fly include demo FS by Norck");
print(" ");
print("=========================================\n ");
return 1;
}

public OnPlayerConnect(playerid)
{
InitFly(playerid);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/fly",true))
{
if(IsPlayerVipType(playerid,3))
{
StartFly(playerid);
return 1;
}
else
SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You are not a premium Member!");
return 1;
}
if(!strcmp(cmdtext,"/stopfly",true))
{
StopFly(playerid);
return 1;
}
return 0;
}

Please help me.
Reply
#2

You simply don't use the strtok function (String Token) - which is commonly used to read params in commands.

I believe this function is included in either the fly.inc or ladmin.inc, and to hide the warning you can simply put this on top underneath your includes:
pawn Код:
#pragma unused strtok
Reply
#3

It's a warning, not an error. It just says that this symbol "strtok" is never used.
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;
}
So, you don't need this.
Reply
#4

thank you very mutch
Reply
#5

i got a new problem where scould i place dwanes stuff ? it just say: symbol already defined: "strtok"
Reply
#6

I can compile, but when i am loggin in as lvl 3 vip and use the cmd it just say you are not a premium member
Reply
#7

You defined it and it says that "strtok" is never used. If you read better my post, you'll see that I said
Quote:
Originally Posted by Dwane
Посмотреть сообщение
It's a warning, not an error. It just says that this symbol "strtok" is never used.
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;
}
So, you don't need this.
Don't add it to your script as you already have it!

You can edit your post, you don't need to double post and are you sure the variable is assigned to 3?
Reply
#8

Ok, but when i goto my game as vip lvl 3 it just say "ERROR: You are not a premium Member!
Reply
#9

Check your scriptfiles folder - there should be a user file named after you there (probably) where you can edit your member status.
Reply
#10

i did and i am vip lvl 3 but ty for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)