[Need Help] Command not working in-game
#1

Hi can anyone tell me wats wrong with this script? I compile perfectly but in-game nothing working :/

Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Events System");
	print("--------------------------------------\n");
	return 1;
}
new Events;
new Float:Event[3];

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmd, "/startevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
             if(IsPlayerAdmin(playerid)) && (!EventStarted))
            {
                EventStarted = 1;
                EventLocked = 0;
                GetPlayerPos(playerid,ex,ey,ez);
                GetPlayerVirtualWorld(playerid);
                GetPlayerInterior(playerid);
                BroadCast(COLOR_LIGHTBLUE, "** Notice: An Event has started, use /joinevent.");
            }
            else if (PlayerInfo[playerid][pAdmin] >= 5 && (EventStarted))
            {
                EventStarted = 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/joinevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(EventStarted == 0)
            {
                  SendClientMessage(playerid, COLOR_LIGHTBLUE, " ** An Event has not Started.");
                  return 1;
            }
            else if(EventLocked == 1)
            {
                  SendClientMessage(playerid, COLOR_RED, "** The event is locked.");
                  return 1;
            }
            new EJoin = strval(tmp);
            new vw = GetPlayerVirtualWorld(playerid);
            SetPlayerPos(playerid,ex,ey,ez);
            SetPlayerVirtualWorld(playerid,vw);
            SetPlayerInterior(playerid,EventInfo[EJoin][EInterior]);
            PlayerInfo[playerid][pInt] = EventInfo[EJoin][EInterior];
        }
        return 1;
    }
    if(strcmp(cmd, "/lockevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        	if(IsPlayerAdmin(playerid))
            {
                EventLocked = 1;
                BroadCast(COLOR_YELLOW, "** Notice: The event has been locked by a Admin **");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
#endif
Reply
#2

Change
pawn Код:
if(strcmp(cmd, "/startevent", true) == 0)
To
pawn Код:
if(strcmp(cmdtext, "/startevent", true) == 0)
And same goes with all the other commands.
Reply
#3

I did but its same, Nothing happens in-game (Logged into rcon)
Reply
#4

Where is EventStarted defined? Does the command say unknown command or something like that?
Reply
#5

I don't have it defined, maybe its the prob, How can i get it defined because I took this script from sa-mp forum
Reply
#6

Can you post the link from you downloaded it?
Reply
#7

there is https://sampforum.blast.hk/showthread.php?tid=265796
Reply
#8

check your script:
pawn Код:
#if defined FILTERSCRIPT
and at the end of script:
pawn Код:
#endif
You need to add this: (or remove the both code above)
pawn Код:
#define FILTERSCRIPT
if you already have that code(above) in your script, maybe you just have comment like this (double slash):
pawn Код:
//
just delete them

NOTE: when you added that(or remove the comment), you may that you will get some errors because some variables/functions are not defined
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)