#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; } |
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; } |
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. |
CMD:*******(playerid, params[]) { SendClientMessage(playerid, 0x00000000, "Hello *******"); return 1; } |
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. |
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; }
if(playerinfo[playerid][AdminLevel] >= rankhere)
SendClientMessage(playerid, 0xFFFFFFAA "You do not have the right admin permissions for this command!"); |
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. |
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. |
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;
}
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;
}
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;
}