Elevator Moving
#1

Guys,i need help with this,when i join game and type /up there says unknown command

Код:
#include <a_samp>
#if defined FILTERSCRIPT
new elevator;
elevator = CreateObject(976,2907.84814453,-1990.46643066,0.88099957,0.00000000,0.00000000,0.00000000);

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" MOVE OBJECT ");
	print("--------------------------------------\n");
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
	{
        if(strcmp(cmd, "/up", true) == 0) {
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/down", true) == 0) { // Same deal as before
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}
#endif
Reply
#2

Quote:
Originally Posted by [DJ]Boki
Посмотреть сообщение
Guys,i need help with this,when i join game and type /up there says unknown command

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/up", true) == 0) {
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/down", true) == 0) { // Same deal as before
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}
#endif[/code]
I think You havent closed On Player Command Text.

it should be Like this

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
    {
        if(strcmp(cmd, "/up", true) == 0) {
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/down", true) == 0) { // Same deal as before
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}
    return 0;

}
++

you missed
return 0;
over there.
Reply
#3

Still don't work
Reply
#4

maybe u didn't load fs properly?
Reply
#5

Remove #if defined FILTERSCRIPT and #end if
Reply
#6

i agree with Conroy try to remove them.
Reply
#7

Код:
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(3) : error 010: invalid function or declaration
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(14) : error 017: undefined symbol "cmd"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : error 017: undefined symbol "COLOR_RED"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(19) : warning 217: loose indentation
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(19) : error 017: undefined symbol "cmd"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(21) : error 017: undefined symbol "COLOR_RED"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(24) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

try to put this under OnPlayerCommandText

Код:
new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
it look like this

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
Reply
#9

Quote:
Originally Posted by IvancheBG
Посмотреть сообщение
try to put this under OnPlayerCommandText

Код:
new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
it look like this

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
Код:
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(4) : error 010: invalid function or declaration
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 219: local variable "cmd" shadows a variable at a preceding level
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(17) : error 017: undefined symbol "strtok"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(17) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(18) : warning 217: loose indentation
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(20) : error 017: undefined symbol "COLOR_RED"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(23) : warning 217: loose indentation
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(25) : error 017: undefined symbol "COLOR_RED"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(28) : warning 217: loose indentation
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 203: symbol is never used: "idx"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16 -- 31) : warning 203: symbol is never used: "cmd"
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16 -- 31) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#10

Quote:
Originally Posted by Conroy
Посмотреть сообщение
Remove #if defined FILTERSCRIPT and #end if
Wtf you and Jagat is saying?

Why shuld he remove that?

And thats not even problem.

DJ Boki i suggust you to use Zcmd.
Thats it. it will work.

ThanKs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)