Kick Command
#1

I put in
Quote:

//---------------------------------------------[Kick]-----------------------------------------------------
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_ADMIN, string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

The errors
Quote:

C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(160) : error 017: undefined symbol "COLOR_GRAD2"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(163) : error 017: undefined symbol "giveplayerid"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(163) : error 017: undefined symbol "ReturnUser"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(166) : error 017: undefined symbol "giveplayerid"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(16 : error 017: undefined symbol "giveplayerid"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(170) : error 017: undefined symbol "giveplayerid"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(170) : error 017: undefined symbol "giveplayer"
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(170) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\samp02Xserver.win32 \gamemodes\b3gw.pwn(170) : fatal error 107: too many error messages on one line

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


9 Errors.

And yes I have register login script.
Reply
#2

I dont need smart comments. I just need to find how to get the stuff defined.
Reply
#3

thats obiously ripped off another admin system
Reply
#4

I know it is, but since its ripped off a GF script and my script has a GF based register/login the command would for if giveplayer was defined. but I can find the define for it.
Reply
#5

First,

Unless the make of the GF script said you cant steal the commands you can do what you want with them.

Second, If you copied the command from one script and it worked then the defines are in the script. They have to be other wise that script wouldnt work either. Just hit CTRL + F and type the undefined symbol in. Then hit ENTER or Click Ok on the box. Then hit F3 until you find the #define code for your undefinded symbol. Then all you do is copy it over to your new GF script.

Pretty Easy,

Rick
Reply
#6

Quote:
Originally Posted by Rick_Jones
First,

Unless the make of the GF script said you cant steal the commands you can do what you want with them.

Second, If you copied the command from one script and it worked then the defines are in the script. They have to be other wise that script wouldnt work either. Just hit CTRL + F and type the undefined symbol in. Then hit ENTER or Click Ok on the box. Then hit F3 until you find the #define code for your undefinded symbol. Then all you do is copy it over to your new GF script.

Pretty Easy,

Rick
First,

The GF script can be used by anyone.

Second, the define doesnt have to be #define, it can be anything from public callbacks to fowards.
Reply
#7

It's none of those, it's a variable, on the GF script it's right under OnPlayerCommandText.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)