Problem!!! need Help
#1

Yes, I am looking for the solution of the problem.
But has not received aid!

Could you help?

Код:
//==============================================================================
//=================================Gate System==================================
//==============================================================================

#include <a_samp>

new obj;

public OnGameModeInit()
{
obj = CreateObject(980,2107.968506,1970.185425,13.005812,0.0000,359.1406,272.4236);//object Gate
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText()
{
if(strcmp(cmdtext,"/gateclose",true)==0)//close gates
{
MoveObject(obj,2107.968506,1970.185425,13.005812,2.00);//cordinates close gate
}
if(strcmp(cmdtext, "/gateopen", true) == 0)//open gates
{
MoveObject(obj,2107.968506,1982.012695,13.005812,2.00);//cordinates open gate
}
return 0;
}
And I get 2 Errors!
Код:
C:\Documents and Settings\name\Desktop\Untitled.pwn(20) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\name\Desktop\Untitled.pwn(24) : error 017: undefined symbol "cmdtext"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Код:
if(strcmp("/cmdhere", cmdtext, true, 10) == 0)
Try that?
Reply
#3

same errors
Reply
#4

Instead of cmdtext try cmd
Reply
#5

damn same errors
Reply
#6

You messed up your callback public

pawn Код:
public OnPlayerCommandText()
OnPlayerCommandText has parameters!

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
Reply
#7

thank you dude! :P
Reply
#8

if (strcmp("/gateopen", cmdtext, true, 0) == 0)
{
MoveObject(obj,2107.968506,1982.012695,13.005812,2 .00);//cordinates open gate
return 1;
}
if (strcmp("/gateclose", cmdtext, true, 0) == 0)
{
MoveObject(obj,2107.968506,1970.185425,13.005812,2 .00);//cordinates close gate
return 1;
}

Try that... I know it will work, you forgot return 1;
at the end
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)