SA-MP Forums Archive
Problem!!! need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem!!! need Help (/showthread.php?tid=92595)



Problem!!! need Help - BLACK-RIDER-1692 - 21.08.2009

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.



Re: Problem!!! need Help - Antonio [G-RP] - 21.08.2009

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


Re: Problem!!! need Help - BLACK-RIDER-1692 - 21.08.2009

same errors


Re: Problem!!! need Help - Antonio [G-RP] - 21.08.2009

Instead of cmdtext try cmd


Re: Problem!!! need Help - BLACK-RIDER-1692 - 21.08.2009

damn same errors


Re: Problem!!! need Help - Joe Staff - 21.08.2009

You messed up your callback public

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

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



Re: Problem!!! need Help - BLACK-RIDER-1692 - 21.08.2009

thank you dude! :P


Re: Problem!!! need Help - Antonio [G-RP] - 21.08.2009

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