/enter /exit
#1

Hello, trying to make a /enter /exit command with a pickup but I keep getting errors, I want the script as a filterscript.

Here are the errors:

Код:
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(7) : error 017: undefined symbol "infopickup"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(19) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(21) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(23) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(28) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(30) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(32) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrator\Desktop\entercmd.pwn(37) : error 030: compound statement not closed at the end of file (started at line 30)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.

This is the script with the errors:

Код:
#include <a_samp>

new dollarpickup;

public OnFilterScriptInit()
{
infopickup = CreatePickup(1274,1,615.8764,-1512.9479,15.3576);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == dollarpickup)
        {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
        }
    return 1;
}
public OnPlayerCommandText()
{
if (strcmp("/enter", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,615.8764,-1512.9479,15.3576))
            {
                SetPlayerPos(playerid,614.9377,-1513.0111,15.4176);
                return 1;
            }

    }
if (strcmp("/exit", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,614.9377,-1513.0111,15.4176))
            {
                SetPlayerPos(playerid,615.8764,-1512.9479,15.3576);
                return 1;
            }

Thanks!
Reply
#2

I made something for you, but edited to ZCMD, here it is:
pawn Код:
#include <a_samp>
#include <zcmd>

#define FILTERSCRIPT

new dollarpickup;

public OnFilterScriptInit()
{
dollarpickup = CreatePickup(1274,1,615.8764,-1512.9479,15.3576);
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == dollarpickup)
        {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
        }
    return 1;
}


CMD:enter(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid,10,615.8764,-1512.9479,15.3576))
        {
                SetPlayerPos(playerid,614.9377,-1513.0111,15.4176);
                return 1;
        }
        else return SendClientMessage(playerid, -1, "You are not in range of the entrance!");
       
}


CMD:exit(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid,10,614.9377,-1513.0111,15.4176))
            {
                SetPlayerPos(playerid,615.8764,-1512.9479,15.3576);
                return 1;
            }
        return 1;
}
Reply
#3

pawn Код:
#include <a_samp>

new infopickup;

public OnGameModeInit()
{
infopickup = CreatePickup(1274,1,615.8764,-1512.9479,15.3576);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == infopickup)
    {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
    }
    return 1;
}
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/exit", cmdtext, true, 6) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid,10,614.9377,-1513.0111,15.4176))
    {
    SetPlayerPos(playerid,615.8764,-1512.9479,15.3576);
    }
    return 1;
    }
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid,10,615.8764,-1512.9479,15.3576))
    {
    SetPlayerPos(playerid,614.9377,-1513.0111,15.4176);
    }
    return 1;
    }
    return 1;
    }
Reply
#4

Thanks, both of you !!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)