Pen1 Edit, command failure.
#1

Okay, so I'm editing the Public Enemy No. 1 script, but the /veh command crashes me
Here's the command;

pawn Код:
if (strcmp(cmd, "/veh", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [vehicleid]");
            return 1;
        }
        if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
        {
            new weaponid = strval(tmp);
            new Float:px, Float:py, Float:pz, Float:pa;
            GetPlayerFacingAngle(playerid,pa);
            GetPlayerPos(playerid, px, py, pz);
            new coordsstring[256];
            format(coordsstring, 256, "CreateVehicle(%d, %.1f,%.1f,%.1f,%.1f,-1,-1,-1);\n", weaponid, px, py, pz ,pa);
            printf("AdmCmd:veh: %d was spawned", weaponid);
            CreateVehicle(weaponid, px, py, pz, pa,-1,-1,10000);
            new File:hFile;
            hFile = fopen("coords.txt", io_append);
            fwrite(hFile, coordsstring);
            fclose(hFile);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
        }
        return 1;
    }
Compiling goes fine, but if I try to spawn a car ingame, I crash.
Help would be highly appreciated!
Reply


Messages In This Thread
Pen1 Edit, command failure. - by Mr. M - 12.08.2009, 17:29
Re: Pen1 Edit, command failure. - by Adil - 12.08.2009, 19:25
Re: Pen1 Edit, command failure. - by Memoryz - 12.08.2009, 19:29
Re: Pen1 Edit, command failure. - by Mr. M - 13.08.2009, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)