Help me with xgoto - 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: Help me with xgoto (
/showthread.php?tid=215116)
Help me with xgoto -
Negat1Ve - 22.01.2011
Hello, someone can tell me why i get these errors?
Код:
C:\Documents and Settings\Reinis\Desktop\Reinis\GTA\xxxxx\filterscripts\xgoto.pwn(44) : error 017: undefined symbol "dcmd_xgoto"
C:\Documents and Settings\Reinis\Desktop\Reinis\GTA\xxxxx\filterscripts\xgoto.pwn(45) : error 017: undefined symbol "dcmd_xgoto"
C:\Documents and Settings\Reinis\Desktop\Reinis\GTA\xxxxx\filterscripts\xgoto.pwn(48) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
My code is this:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <sscanf>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(xgoto, 5, cmdtext);
dcmd_xgoto(playerid, params[])
{
new Float:x, Float:y, Float:z;
if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "USE: \"/xgoto <X Float> <Y Float> <Z Float>\"");
else
{
new string[64];
SetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "You've set your coord to %f, %f, %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
return 0;
}
Re: Help me with xgoto -
veyron - 22.01.2011
other part of the command must be outside onplayercommandtext
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(xgoto, 5, cmdtext);
return 0;
}
dcmd_xgoto(playerid, params[])
{
new Float:x, Float:y, Float:z;
if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "USE: \"/xgoto <X Float> <Y Float> <Z Float>\"");
else
{
new string[64];
SetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "You've set your coord to %f, %f, %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
Re: Help me with xgoto -
Negat1Ve - 22.01.2011
Big Thanks!