Command Help -
ZombieNest - 19.10.2013
Hello i am new in scripting i need help in making a command and learn how to use a command on 1 and 2 player ex /vipkick 1 so i tryed to make a one it shows errors:
the error iss this
Код:
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(11) : warning 217: loose indentation
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(20) : error 001: expected token: ";", but found "}"
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(23) : warning 225: unreachable code
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(27) : error 001: expected token: ";", but found "}"
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(30) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(35) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(37) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(42) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(44) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(49) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(51) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(56) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(58) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(63) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(65) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(70) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(72) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(77) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(79) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(84) : error 010: invalid function or declaration
C:\Users\Alee\Desktop\ARP\filterscripts\vipcommands.pwn(86) : error 026: no matching "#if..."
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
19 Errors.
And the filter script is this:
Код:
#include <a_samp>
public OnFilterScriptInit()
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, 0x00FF00AA, "View Server Updates By Using /serverupdates .");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("vipkick1", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(1)
}
return 1;
if (strcmp("vipkick2", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(2)
}
return 1;
}
if (strcmp("vipkick3", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(3)
}
return 1;
}
if (strcmp("vipkick4", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(4)
}
return 1;
}
if (strcmp("vipkick5", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(5)
}
return 1;
}
if (strcmp("vipkick6", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(6)
}
return 1;
}
if (strcmp("vipkick7", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(7)
}
return 1;
}
if (strcmp("vipkick8", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(8)
}
return 1;
}
if (strcmp("vipkick9", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(9)
}
return 1;
}
if (strcmp("vipkick10", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(10)
}
return 1;
#endif
please help me with this errors i dont know exactly whats the error wrong line
I read alot of tutorials but i didnt understand if you show me a script which makes a kick command like /vipkick 1 i cant understand
Re: Command Help -
Konstantinos - 19.10.2013
Download ZCMD and sscanf, they're BETTER than strcmp and strtok for commands.
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <sscanf2>
#include <zcmd>
public OnFilterScriptInit()
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, 0x00FF00AA, "View Server Updates By Using /serverupdates .");
return 1;
}
CMD:vipkick1(playerid, params[])
{
// if( /* check if they're not VIP */ ) return error..
new id;
if(sscanf(params, "r", id)) return SendClientMessage(playerid, -1, "Usage: /vipkick <ID/Part Of Name>");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player");
SendClientMessage(playerid,0xAA333AA, "(Player Has Been Kicked");
Kick(id);
return 1;
}
Re: Command Help -
ZombieNest - 19.10.2013
THANKS VERY MUCH!!!!!!!!!!!!!!
Re: Command Help -
rickisme - 19.10.2013
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
public OnFilterScriptInit()
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, 0x00FF00AA, "View Server Updates By Using /serverupdates .");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/vipkick", true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xAA333AA, "USAGE: /vipkick [playerid]");
if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid, 0xAA333AA, "That person does not connect");
SendClientMessage(playerid,0xAA333AA, "Player Has Been Kicked");
Kick(strval(tmp));
return 1;
}
}