SA-MP Forums Archive
help over here - 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: help over here (/showthread.php?tid=421142)



help over here - Theghost1 - 08.03.2013

this s my new filterscript but when im going to test my server told me UNKNOWN COMMAND

Код:
#include <a_samp>
#include <a_players>

#if defined FILTERSCRIPT
if(!strcmp(cmdtext, "/test", true)){
	if(!IsPlayerInAnyVehicle(playerid)){
		SetPlayerPos(playerid, 100.0, 100.0, 1.0);
		SetPlayerFacingAngle(playerid, 0.0);
		SetPlayerInterior(playerid, 0);
		SetPlayerVirtualWorld(playerid, 1);
	}
	else{
		new veh = GetPlayerVehicleID(playerid);
		SetVehiclePos(veh, 0.0, 0.0, 0.0);
		SetVehicleZAngle(veh, 0.0);
		LinkVehicleToInterior(veh, 0);
		SetVehicleVirtualWorld(veh, 1);
		PutPlayerInVehicle(playerid, veh, 11);
	}
	return 1;
}
#endif



Re: help over here - Theghost1 - 08.03.2013

help plzzzz


Re: help over here - greentarch - 08.03.2013

Put it at OnPlayerCommandText ..
pawn Код:
#define FILTERSCRIPT
#include < a_samp >

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if(!strcmp(cmdtext, "/test", true)){
        if(!IsPlayerInAnyVehicle(playerid)){
            SetPlayerPos(playerid, 100.0, 100.0, 1.0);
            SetPlayerFacingAngle(playerid, 0.0);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 1);
        }
        else {
            new veh = GetPlayerVehicleID(playerid);
            SetVehiclePos(veh, 0.0, 0.0, 0.0);
            SetVehicleZAngle(veh, 0.0);
            LinkVehicleToInterior(veh, 0);
            SetVehicleVirtualWorld(veh, 1);
            PutPlayerInVehicle(playerid, veh, 11);
        }
        return 1;
    }

    return 0;
}
Untested, should works.


Re: help over here - Theghost1 - 08.03.2013

ot working


Re: help over here - L.Hudson - 08.03.2013

if you are using ZCMD meaning if you have a command like CMD:help or COMMAND:help or YCMD:help the /test cmd will not work


Re: help over here - ajam123 - 08.03.2013

pawn Код:
#include <a_samp>
#include <a_players>

#define FILTERSCRIPT

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/test", true) == 0)
        if(!IsPlayerInAnyVehicle(playerid)){
            SetPlayerPos(playerid, 100.0, 100.0, 1.0);
            SetPlayerFacingAngle(playerid, 0.0);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 1);
        }
        else {
            new veh = GetPlayerVehicleID(playerid);
            SetVehiclePos(veh, 0.0, 0.0, 0.0);
            SetVehicleZAngle(veh, 0.0);
            LinkVehicleToInterior(veh, 0);
            SetVehicleVirtualWorld(veh, 1);
            PutPlayerInVehicle(playerid, veh, 11);
        }
        return 1;
    }

    return 0;
}



Re: help over here - Theghost1 - 08.03.2013

Still not working

Код:
#define FILTERSCRIPT
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/seatbelt", true) == 0)
        if(!IsPlayerInAnyVehicle(playerid)){
            SetPlayerPos(playerid, 100.0, 100.0, 88.0);
            SetPlayerFacingAngle(playerid, 0.0);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 1);
			GivePlayerWeapon(playerid, WEAPON_DEAGLE, 1000);
			SetPlayerSkin(playerid, 14);


        }
        else {
            new veh = GetPlayerVehicleID(playerid);
            SetVehiclePos(veh, 0.0, 0.0, 0.0);
            SetVehicleZAngle(veh, 0.0);
            LinkVehicleToInterior(veh, 0);
            SetVehicleVirtualWorld(veh, 1);
            PutPlayerInVehicle(playerid, veh, 11);
        }
        return 1;
    }

    return 0;
}



Re: help over here - ajam123 - 08.03.2013

Hurm


Re: help over here - RajatPawar - 08.03.2013

For curiosity's sake, why are you including <a_players>?


Re: help over here - kaisersouse - 08.03.2013

Anyone stop to notice he has no onfilterscriptinit?

No.

You have no onfilterscriptinit. Grab one of the FSs that come with SAMP, gut everything except the include, onfilterscriptinit and then put in your onplayercommandtext.