07.03.2012, 17:33
Everytime I try use a command it says "that player is not connected" - Obviously when they are. Before it worked, it's stopped. What are the usual causes of this?
CMD:kick(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new reason[128], giveplayerid;
if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /kick [player id] [reason]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");
format(reason, sizeof(reason), "Admin %s Kicked %s [Reason: %s ]", GetNameEx(playerid), GetNameEx(giveplayerid), reason);
SendClientMessageToAll(COLOUR_REALRED, reason);
Kick(giveplayerid);
return 1;
}
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");
CMD:armour(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(IsPlayerInRangeOfPoint(playerid, 5,962.6015, 2101.4980, 1011.0267) && Faction[playerid] == 3 || IsPlayerInRangeOfPoint(playerid, 5, 321.1703,308.9879,999.1484) && Faction[playerid] == 1)
{
ShowPlayerDialog(playerid, DIALOG_ARMOUR, DIALOG_STYLE_LIST, "Armour Selection(Also provides health.)", "Standard Armour\nKevlar Vest(Increased Protection)\nHealth\n", "Select", "Cancel");
}
return 1;
}
CMD:removevest(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(!IsPlayerAttachedObjectSlotUsed(playerid, 0))return SendClientMessage(playerid, COLOUR_GREY, "You do not have a Kevlar Vest attached.");
RemovePlayerAttachedObject(playerid, 0);
SetPlayerArmour(playerid, 0);
SendClientMessage(playerid, COLOUR_BLUE, "Kevlar Vest removed.");
return 1;
}
else if(dialogid == DIALOG_ARMOUR)
{
if(response == 0)
{
return 1;
}
if(listitem == 0)
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, COLOUR_BLUE, "Standard Armour Retrieved.");
}
if(listitem == 1)
{
SetPlayerAttachedObject(playerid,0,19142,1,0.10,0.03,0.00,-1.0,-3.0,2.0,0.93,1.23,1.18);
SetPlayerArmour(playerid, 150.0);
SendClientMessage(playerid, COLOUR_BLUE, "Kevlar Vest Retrieved, Armour Protection has increased.");
}
if(listitem == 2)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOUR_BLUE, "Health Restored.");
}
}