PDA

View Full Version : help over here


Theghost1
08/03/2013, 12:43 PM
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

Theghost1
08/03/2013, 12:46 PM
help plzzzz

greentarch
08/03/2013, 12:49 PM
Put it at OnPlayerCommandText ..

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

Theghost1
08/03/2013, 12:56 PM
ot working

L.Hudson
08/03/2013, 01:04 PM
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

ajam123
08/03/2013, 01:04 PM
#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;
}

Theghost1
08/03/2013, 01:17 PM
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;
}

ajam123
08/03/2013, 01:34 PM
Hurm

RajatPawar
08/03/2013, 01:34 PM
For curiosity's sake, why are you including <a_players>?

kaisersouse
08/03/2013, 01:35 PM
Anyone stop to notice he has no onfilterscriptinit (http://wiki.sa-mp.com/wiki/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.

zxc1
08/03/2013, 01:39 PM
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, 0);
}
return 1;
}
return 0;
}