ZCMD isn't working :/ ?
#1

That is my script and here is the include

Quote:

#include <a_samp>

#include <zcmd>

#include <sscanf2>

new Gate;

new Pickup;


#if defined FILTERSCRIPT


public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Test by Fanfo");
print("--------------------------------------\n");
return 1;
}

The goto command

Quote:

if (strcmp("/kill", cmdtext, true, 5) == 0)
{
SetPlayerHealth (playerid, 0);
SendClientMessage (playerid, 0x00000000, "You Have Commited Suicide!");
return 1;
}


CMD:goto(playerid, params[])
{
new targetid;
if(sscanf(params,"d", targetid) return SendClientMessage(playerid, 0xFFFFFFAA, "Usage:/goto [PLAYERID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA,"Player Is Not Connected");
new Float,Float:y,Float:z;
GetPlayerPos(targetid, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
SendClientMessage(playerid, 0xFFFFFFAA, "You have been successfully Teleported!");



return 1;
}

And the errors

Quote:

C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : warning 217: loose indentation
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 017: undefined symbol "cmd_goto"
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

I am noob at coding so help me please
Reply
#2

also This doesn't work

Quote:

CMD:*******(playerid, params[])
{
SendClientMessage(playerid, 0x00000000, "Hello *******");

return 1;
}

Error

Quote:

C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : warning 217: loose indentation
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 017: undefined symbol "cmd_*******"
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(357) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#3

Try this
Код:
CMD:kill(playerid, params[])
{
    {
        SetPlayerHealth(playerid, 0);
        return 1;
    }
    return 0;
}


CMD:goto(playerid,params[])
{
	new targetid;
	if(sscanf(params, "u", targetid)) SendClientMessage(playerid, 0xFFFFFFAA" /goto [playerid]");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA" Player is not online");

	new Float:x,Float:y,Float:z;
	GetPlayerPos(targetid,Float:x,Float:y,Float:z);
    SetPlayerPos(playerid, Float:x, Float:y, Float:z);
    }
    else {
    SendClientMessage(playerid, 0xFFFFFFAA "You do not have the right admin permissions for this command!");
    }
    return 1;
}
CMD:*******(playerid, params[])
{
SendClientMessage(playerid, 0x00000000, "Hello *******");
return 1;
}
Dont leave a space between return 1; and the send client message
Then /goto cmd I made it for admins though you must need to add
Код:
if(playerinfo[playerid][AdminLevel] >= rankhere)
Reply
#4

NOTE:
use the ZCMD code outside the callback i mean if ur code is inside any callback like OnPlayerCommandtext, it wont work. I dont see any error in ur code.

@tomix
Quote:

SendClientMessage(playerid, 0xFFFFFFAA "You do not have the right admin permissions for this command!");

U missed a ',' to seperate color and text.
Reply
#5

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
NOTE:
use the ZCMD code outside the callback i mean if ur code is inside any callback like OnPlayerCommandtext, it wont work. I dont see any error in ur code.

@tomix

U missed a ',' to seperate color and text.
Quote:

C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : warning 217: loose indentation
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : error 017: undefined symbol "cmd_kill"
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : error 029: invalid expression, assumed zero
C:\Users\zero\Desktop\SAMP Server\gamemodes\Test.pwn(349) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

That happened when i copied his script
Reply
#6

pawn Код:
CMD:kill(playerid, params[])
{
    SetPlayerHealth(playerid, 0);
    return 1;
}

CMD:goto(playerid,params[])
{
    new targetid;
    if(sscanf(params, "u", targetid)) SendClientMessage(playerid, 0xFFFFFFAA,"/goto [playerid]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA" Player is not online");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(targetid,Float:x,Float:y,Float:z);
    SetPlayerPos(playerid, Float:x, Float:y, Float:z);
    }
    else {
    SendClientMessage(playerid, 0xFFFFFFAA, "You do not have the right admin permissions for this command!");
    }
    return 1;
}

CMD:*******(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFFAA, "Hello *******");
return 1;
}
Reply
#7

Show us line 349
Reply
#8

pawn Код:
CMD:goto(playerid, params[])
{
    new targetid;
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You do not have the right admin permissions for this command!");
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA,"/goto [playerid]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA" Player is not online");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(targetid,Float:x,Float:y,Float:z);
    SetPlayerPos(playerid, Float:x, Float:y, Float:z);
    return 1;
}
Reply
#9

Quote:
Originally Posted by iZN
Посмотреть сообщение
pawn Код:
CMD:goto(playerid, params[])
{
    new targetid;
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You do not have the right admin permissions for this command!");
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA,"/goto [playerid]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA" Player is not online");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(targetid,Float:x,Float:y,Float:z);
    SetPlayerPos(playerid, Float:x, Float:y, Float:z);
    return 1;
}
Correction:
pawn Код:
CMD:goto(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "You do not have the right admin permissions for this command!");
    new targetid;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA,"/goto [playerid]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA" Player is not online");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(targetid,Float:x,Float:y,Float:z);
    SetPlayerPos(playerid, Float:x, Float:y, Float:z);
    return 1;
}
:P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)