SA-MP Forums Archive
SERVER: Unknown Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SERVER: Unknown Command (/showthread.php?tid=416218)



SERVER: Unknown Command - Ld Est Ld - 16.02.2013

pawn Код:
CMD:gotoplayervehicle(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 2) {
        new
            userID,
            veh = GetPlayerVehicleID(playerid)
        ;

        if(sscanf(params, "u", userID))
            return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/gotoplayervehicle [playerid]");

        if(userID == INVALID_PLAYER_ID)
            return SendClientMessage(playerid, COLOR_GREY, "Player Is not online");

        if(playerVariables[userID][pCarID] < 1)
            return SendClientMessage(playerid, COLOR_GREY, "This playerdoesn't own vehicle.");

        new
            messageString[64];

        GetVehiclePos(playerVariables[userID][pCarID], playerVehicleVariables[veh][pVehiclePosition][0], playerVehicleVariables[veh][pVehiclePosition][1], playerVehicleVariables[veh][pVehiclePosition][2]);

        SetPlayerPos(playerid, playerVehicleVariables[veh][pVehiclePosition][0], playerVehicleVariables[veh][pVehiclePosition][1]+2, playerVehicleVariables[veh][pVehiclePosition][2]);

        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(playerVariables[userID][pCarID]));

        format(messageString, sizeof(messageString), "You've teleported to %s's %s", playerVehicleVariables[veh][pVehicleOwner], VehicleNames[playerVehicleVariables[veh][pVehicleModelID] - 400]);
        SendClientMessage(playerid, COLOR_WHITE, messageString);
    }
    return 1;
}
It works, but it says, Server unknown comand!


Re: SERVER: Unknown Command - dusk - 16.02.2013

try adding
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    return 1;
}
anyweher on your script


Re: SERVER: Unknown Command - Ld Est Ld - 16.02.2013

I'm using ZCMD processor, so it don't work. (tried also)


Re: SERVER: Unknown Command - M3mPHi$_S3 - 16.02.2013

Does it works fine when you compiled it ?


Re: SERVER: Unknown Command - Ld Est Ld - 16.02.2013

What You mean?

If I type the command InGame, then the command works fine, teleporting to players car, but instead of this message:
You've teleported to %s's %s
I get:
Server: Unknown Command


Re: SERVER: Unknown Command - Ld Est Ld - 16.02.2013

Anyone help?


Re: SERVER: Unknown Command - Gamer_007 - 16.02.2013

So it compiles fine?Huh me too suffered from this.Try converting this cmd to dcmd and then try maybe it works


Re: SERVER: Unknown Command - ReVo_ - 16.02.2013

Array index out of bounds.

format(messageString, sizeof(messageString), "You've teleported to %s's %s", playerVehicleVariables[veh][pVehicleOwner], VehicleNames[playerVehicleVariables[veh][pVehicleModelID] - 400]);

playerVehicleVariables size?
VehicleNames size?

what value contains playerVehicleVariables[veh][pVehicleModelID] ?

(Your code is long so i dont want to read, but this problem might be caused by this.)

Use crashdetect plugin to detect this problem easily.


Re: SERVER: Unknown Command - Ld Est Ld - 16.02.2013

Well, I don't get the VehicleModelID. It's 0 somehow. :/