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
#2

Uh, Wrong Section ?
Reply
#3

This isn't the wrong section >.<


Did you change anything to this command recently?

Or, you probably spawned an invalid model ID.
Reply
#4

Quote:
Originally Posted by Memoryz
This isn't the wrong section >.<


Did you change anything to this command recently?

Or, you probably spawned an invalid model ID.
I haven't changed anything in the script.
I just compiled it to be sure, that went fine, so I started up my local server, got in to test everything and the /veh makes me crash.
I tried multiple model ID's but I still crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)