[HELP] Can't write file (y_ini)
#1

Hello!

I have these testing commands for my server VIP system. These commands will be removed if I put my server online.
The problem with the first command is, that I can't write the timestamp to the users' file. If I type the command, then it says "Unknown command" and nothing else.
The second command is just for testing the variable. /freevip puts my variables right, but doesn't write the files.

Is there something wrong...or doesn't it work that way?
pawn Код:
if(strcmp(cmdtext, "/freevip", true) == 0)
{
        new PlayerFile[256]; PlayerFile = GetPlayerFile(playerid);
        new expire = gettime() + 30*24*60*60;
        Variables[playerid][pVIP] = 1;
        Variables[playerid][pVIPDate] = expire;
        new INI:PFile = INI_Open(PlayerFile);
        INI_WriteInt(PFile,"VIP",1);
        INI_WriteInt(PFile,"VIPDate", expire);
        INI_Close(PFile);
            SendCMDText(playerid,"VIP level 1 activated for 30 days!");
        return 1;
}
if(strcmp(cmdtext, "/vipdate", true) == 0)
{
        new GetVIPDate = Variables[playerid][pVIPDate];
        new string[256];
        format(string,256,"VIP Date: %d",GetVIPDate);
        SendCMDText(playerid,string);
        return 1;
}
Thank You!
Reply
#2

I really recommend you to use ZCMD + SSCANF as it is very OP and easy to use.
I bet if you use ZCMD your cmds are going to be easier to create!
Reply
#3

Quote:
Originally Posted by saffierr
Посмотреть сообщение
I really recommend you to use ZCMD + SSCANF as it is very OP and easy to use.
I bet if you use ZCMD your cmds are going to be easier to create!
I am using ZCMD and SSCANF for my other commands. And that's not what I asked for, but thank you anyway.
Reply
#4

The command failures are related to what he said... Heck knows why your Writeint issue is happening, but looking at the wiki could show something...

https://sampwiki.blast.hk/wiki/Gettime

Quote:

Get the current server time, which will be stored in the variables &hour, &minute and &second.

And paste up GetPlayerFile.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)