23.06.2013, 01:27
MY kick command
It has something to do 0.3x that Kick is over any text or dialougs..
I need to know how to delay itt..
Second one is..
Even if player is in server, it always says :"player not connected"
No compiling errors at all
pawn Код:
dcmd_kick(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
new pname[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"us[100]",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /kick (Player Name/ID) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
format(string, sizeof(string), "~r~KICKED!");
GameTextForPlayer(ID, string, 3000, 1);
format(string,sizeof(string),"[KICKED] Administrator %s(%d) has kicked you from the server. [Reason: %s]",pname,playerid,cmdreason);
SendClientMessage(ID,COLOR_RED,string);
format(string,sizeof(string),"[ADMIN KICK] Administrator has kicked %s(%d). [Reason: %s]",tname,ID,cmdreason);
SendClientMessageToAll(COLOR_PINK,string);
format(string,sizeof(string),"9[ADMIN KICK] Administrator has kicked %s(%d). [Reason: %s]",tname,ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),"[ADMIN RADIO] Administrator %s(%d) has kicked %s(%d). [Reason: %s]",pname,playerid,tname,ID,cmdreason);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
Kick(ID);
return 1;
}
I need to know how to delay itt..
Second one is..
pawn Код:
dcmd_sethealth(playerid,params[])
{
new string[128];
new ID;
new cmdreason;
new pname[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"us[100]",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /sethealth (Player Name/ID) (Health)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"[ERROR] %s(%d) is not spawned to set his health.",tname,ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
format(string,sizeof(string),"[HEALTH] Administrator %s(%d) has set your health to %d.",pname,playerid,cmdreason);
SendClientMessage(ID,COLOR_PINK,string);
format(string,sizeof(string),"[HEALTH] You have set %s(%d)'s health to %d.",tname,ID,cmdreason);
SendClientMessage(playerid,COLOR_PINK,string);
SetPlayerHealth(ID, cmdreason);
format(string,sizeof(string),"[ADMIN RADIO] Administrator %s(%d) has set %s(%d)'s health to %d",pname,playerid,tname,ID,cmdreason);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
return 1;
}
No compiling errors at all