13.03.2011, 13:28
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
dcmd(kick,4,cmdtext);
dcmd(ban,3,cmdtext);
return 0;
}
dcmd_kick(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
new tmp[256], tmp2[256], Index;
tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
new player1, PlayerName[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && PlayerInfo[player1][Admin] == 0)
{
GetPlayerName(player1, PlayerName, sizeof(PlayerName));
if(!strlen(tmp2))
{
format(string,sizeof(string),"***KICK (ADMIN) Player: %s",PlayerName);
SendClientMessageToAll(COLOUR_PINK,string);
print(string);
dUserSetINT(PlayerName2(playerid)).("Kicks",dUserINT(PlayerName2(playerid)).("Kicks")+1);
return Kick(player1);
}
else
{
format(string,sizeof(string),"***KICK (ADMIN) Player: %s Reason: %s ",PlayerName,params[2]);
SendClientMessageToAll(COLOUR_PINK,string);
print(string);
dUserSetINT(PlayerName2(playerid)).("Kicks",dUserINT(PlayerName2(playerid)).("Kicks")+1);
return Kick(player1);
}
} else return SendClientMessage(playerid, COLOUR_RED, "ERROR: Player is not connected, is an admin or is yourself");
}
return 1;
}
dcmd_ban(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
new ip[128], tmp[256], tmp2[256], Index;
tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, COLOUR_WHITE, "USAGE: /ban [playerid] [reason]");
new player1, PlayerName[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && if(PlayerInfo[playerid][pAdminLevel] == 0)
{
GetPlayerName(player1, PlayerName, sizeof(PlayerName));
new year,month,day,hour,minuite,second;
getdate(year, month, day);
gettime(hour,minuite,second);
format(string,sizeof(string),"***BAN (ADMIN) Player: %s Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",PlayerName,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(COLOUR_PINK,string);
print(string);
if(dUserINT(PlayerName2(player1)).("Banned") == 0)
{
dUserSetINT(PlayerName2(player1)).("Banned",1);
}
GetPlayerIp(player1,ip,sizeof(ip));
strdel(ip,strlen(ip)-2,strlen(ip));
format(ip,128,"%s**",ip);
format(ip,128,"banip %s",ip);
SendRconCommand(ip);
return 1;
} else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected, is an admin or is yourself");
}
return 1;
}
Код:
C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1037) : error 017: undefined symbol "Admin" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1045) : error 017: undefined symbol "PlayerName2" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1053) : error 017: undefined symbol "PlayerName2" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1056) : error 017: undefined symbol "COLOUR_RED" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1066) : error 017: undefined symbol "COLOUR_WHITE" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1069) : error 029: invalid expression, assumed zero C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1069 -- 1070) : error 029: invalid expression, assumed zero C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1078) : error 017: undefined symbol "PlayerName2" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1080) : error 017: undefined symbol "PlayerName2" C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1088) : warning 225: unreachable code C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1088) : error 029: invalid expression, assumed zero C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1088) : warning 215: expression has no effect C:\Documents and Settings\User\Desktop\SA-MP 0.3C WINDOWS SERVER\gamemodes\[GM]DMv3.0.pwn.pwn(1088) : error 001: expected token: ";", but found "return" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 11 Errors.