• Welcome to Vice City Multiplayer.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - M4Carbine

#1
mIRC/pawn Scripting / Can't Create files
February 05, 2010, 04:16:01 PM
I just wanted to try making a simplest script using Files.
I wanted to make a script that writes " mode=1" in a GameMode.ini file, which is present in GAME FILE.

The problem I face is :
Script doesn't make a GAME file and its sub-file GameMode.ini
Please help :(
Here is the code:


//files Declerations
#define GAME_FILE           "/mode/%s"
#define GameMode            "/mode/GAME/GameMode"

new file[128];

//commands starts here
if (strcmp(cmd, "modeon", true) == 0) {
format(file,sizeof(file),GAME_FILE,GameMode);
    if(dini_Exists(file)) {
    SendClientMessage(playerid, COLOR_RED, "FILE IS ALREADY CREATED");
    dini_Set(file,"mode", "1");
    }
    else {
    dini_Create(file);
    SendClientMessage(playerid, COLOR_GREEN, "FILE IS NOW CREATED");
    dini_Set(file,"mode", "1");
    }
SendClientMessage(playerid, COLOR_GREEN, "GAME MODE STARTED");
}