Any cmd not working
#1

I made few script 2 as a filterscript and 1 is a normal cmd in my pawno... But there are no errors for any script.. but ther are not working in game... why its not working? i did complie+updated in server.cfg but its still not working...

My 1st script in filterscript:
Код:
#include <a_samp>
#include <zcmd>

new Showing[MAX_PLAYERS];

new Text:Textdraw0;
new target;

public OnFilterScriptInit()
{
	print("Textdraw file generated by");
	print("    Zamaroht's textdraw editor was loaded.");

	// Create the textdraws:
	Textdraw0 = TextDrawCreate(37.000000, 157.000000, "Parking Brake Set");
	TextDrawBackgroundColor(Textdraw0, 255);
	TextDrawFont(Textdraw0, 1);
	TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
	TextDrawColor(Textdraw0, -16776961);
	TextDrawSetOutline(Textdraw0, 0);
	TextDrawSetProportional(Textdraw0, 1);
	TextDrawSetShadow(Textdraw0, 1);
	TextDrawUseBox(Textdraw0, 1);
	TextDrawBoxColor(Textdraw0, 255);
	TextDrawTextSize(Textdraw0, 186.000000, 510.000000);
	TextDrawSetSelectable(Textdraw0, 0);
	TogglePlayerControllable(target,0);
	return 1;
}

public OnFilterScriptExit()
{
	TextDrawHideForAll(Textdraw0);
	TextDrawDestroy(Textdraw0);
	return 1;
}

public OnPlayerConnect(playerid)
{
	Showing[playerid] = 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/setbrake") && Showing[playerid] == 0)
	{
		if(Showing[playerid] == 1)
		{
			Showing[playerid] = 0;
			TextDrawHideForPlayer(playerid, Textdraw0);
			SendClientMessage(playerid,-1,"Vehicle Braked,You have to Unbrake before move!");
		}
		else
		{
			Showing[playerid] = 1;
			TextDrawShowForPlayer(playerid, Textdraw0);
			SetTimerEx("HideTextdraws", 3000, 0, "i", playerid);
		}
	}
	return 1;
}

forward HideTextdraws(playerid);
public HideTextdraws(playerid)
{
	Showing[playerid] = 0;
	TextDrawHideForPlayer(playerid, Textdraw0);
}
2nd:
Код:
//~~~~~~~~~~~~~~~Pizza Missions By Tuntun~~~~~~~~~~~~~~~
//Do Not remove his credits!

#include <a_samp>
#include <zcmd>

new PizzaJob[300];

new IsPlayerInMission[MAX_PLAYERS];

public OnFilterScriptInit()
{
    CreateVehicle(448, 2098.7107, -1821.3761, 12.8967, 0.0000, -1, -1, 100);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/pwork", cmdtext, true))
    {
        new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(IsPlayerInMission[playerid] >= 1) return SendClientMessage(playerid,-1,"You already have a mission!");
        if (pvehiclemodel == 448)
        {
            PizzaJob[playerid] = 1;
            SetPlayerCheckpoint(playerid, 2099.0190,-1806.6707,13.5551,3.5);
            SendClientMessage(playerid, -1,"~g~Info: ~w~Mission started You have to go at 2 houses! Please follow the check point!");
            GameTextForPlayer(playerid,"~w~Mission~g~Started!", 3000, 3);
            return 1;
        }
        SendClientMessage(playerid, -1,"You have to be on a pizza bike to start pizza boy mission!");
    }
    return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        SendClientMessage(playerid,-1,"Must use /pwork to start the mission");
    }
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
    {
        if(PizzaJob[playerid] == 1){ // When he enters the first checkpoint and pizzajob is 1, it should set another checkpoint and say "Go to another house", not "mission started", because it was already started by the command...
            PizzaJob[playerid] = 2;
            SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
            GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
        }
        else if(PizzaJob[playerid] == 2){
            PizzaJob[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
            GivePlayerMoney(playerid,20000);
            GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
            SetPlayerScore(playerid,GetPlayerScore(playerid)+5); // Edited here
            IsPlayerInMission[playerid] = 0; // Added this
        }
    }
    return 1;
}
CMD:pizza(playerid,params[])
{
    SetPlayerPos(playerid,2021.6563, -1810.7266, 18.6016);
    return 1;
}
3rd:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_TUNING:
        {
            if(response)
            {
                if(listitem == 1)
                {
                    new car = GetPlayerVehicleID(playerid);
					SetVehicleHealth(car,20000);
					GivePlayerMoney(playerid,-100);
                }
                return 1;
            }
        }
    }
    return 0;
}
CMD:done(playerid,params[])
{
    DisablePlayerCheckpoint(playerid);
    SendClientMessage(playerid,COLOR_RED,"Checkpoint Canceled!");
    return 1;
}
CMD:garage(playerid,params[])
{
	SetPlayerCheckpoint(playerid, -2034.9296,178.9917,28.8429, 3.0);
	ActiveCheckpoint[playerid] = 1;
	SendClientMessage(playerid,COLOR_RED,"Gps to Sf Garage are started!");
	SendClientMessage(playerid,-1,"To Cancel Gps type /done");
	return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(ActiveCheckpoint[playerid] == 1)
    {
    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Tuning","Repair 100$ ","Ok","Quit");
    }
    return 1;
}
At 3rd the vehicle is not fixing.. i mean after i press repair it doesn't -money and it doesn't fix my car.But no errors
Reply
#2

you havent done #define FILTERSCRIPT at the top of your filterscript, after the includes.
Reply
#3

D:\Trucking\filterscripts\check2.pwn(46) : error 017: undefined symbol "target"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Why do you use that variable? because OnFilterScriptInit doesnt apply to any player. Simply omit that TogglePlayerControllable and that variable.
Reply
#5

Remove this:

pawn Код:
TogglePlayerControllable(target,0);
This makes absolutely no sense what-so-ever. You are learning Pawn wrong.
Reply
#6

basically your trying to freeze a player, but OnGameModeInit is for the server so your trying to freeze the server? lol...
Reply
#7

i trying to freeze system with a command. /brake for freeze... with textdrawy that i made^^ still nothing is working.. i already #define everything but still not working..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)