Add pickups command?
#1

Hey,

I was just wondering, is there any way to add pickups from a .cfg file?

EG:

1: IG admin/rcon admin can do /createpickup [pickupid]
2: It saves to /scriptfiles/pickups.cfg
3: On server restart/gmx pickups from pickups.cfg are loaded.

??

EDIT:

Why doesn't this work?

pawn Код:
if (strcmp(cmdtext, "/apu", true)==0)
  {
      if(IsPlayerConnected(playerid))
        {
          if(PlayerInfo[playerid][pAdmin] >= 1337)
          {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /houseo [housenumber]");
                    return 1;
                }
                new Float:pix;
                new Float:piy;
                new Float:piz;
                GetPlayerPos(playerid, pix, piy, piz);
            new File:pos=fopen("pickups.txt", io_append);
            format(string, 256, "AddStaticPickup(%d,2, %f, %f, %f);", tmp, pix, piy, piz);
            fwrite(pos, string);
            fclose(pos);
                SendClientMessage(playerid, COLOR_GREEN, string);
            }
        }


    return 1;
  }
Reply
#2

Код:
new File: file = fopen(missionname, io_read);
try that isntead to read the file
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)