31.12.2010, 14:53
Hey can anyones tell me how to create /goto command with sscanf and zcmd?
![Cheesy](images/smilies/biggrin.png)
![Cheesy](images/smilies/biggrin.png)
#include <a_samp>
#include <zcmd>
#include <sscanf2>
command(goto, playerid, params[])
{
new ID;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xF97804FF, "USAGE: /goto [id]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, 0xF97804FF, "Player is not connected!");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
}
return 1;
}
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 017: undefined symbol "command"
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 029: invalid expression, assumed zero C:\Users\maxime\Desktop\cmdclan.pwn(100) : error 017: undefined symbol "params" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |
CMD:goto(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new ID;
new Str[64];
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
}
return 1;
}