I need help with /sethealth
#1

This is how it looks but when i got in game it says that the player isn't connected. Somehow it stops there. Could someone help me out?
This also happened with my other commands.
Thank you.

Код:
CMD:sethealth(playerid, params[])
{
    new id;
    new hp;
    if(PlayerInfo[playerid][pAdmin] >= 6)
            {
                        if(!sscanf(params, "ui", id, hp))
                        {
                					if(!IsPlayerConnected(id))
									{
                                        SendClientMessage(playerid, -1, "SERVER: The player isn't connected.");
								     	return 1;
									}
                                    new string[64];
                                    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                                    GetPlayerName(playerid, name, sizeof(name));
                                    GetPlayerName(id, PlayerName, sizeof(PlayerName));
                                    format(string, sizeof(string), "SERVER: Administrator %s has set your health to %d", name, hp);
                                    SendClientMessage(id, BLUE, string);
                                    format(string, sizeof(string), "SERVER: You have Set %s health to %d.", PlayerName, hp);
                                    SendClientMessage(playerid, BLUE, string);
                                    SetPlayerHealth(id, hp);
                                    return 1;
                        }
                        else return SendClientMessage(playerid, -1, "SERVER: /sethealth [PlayerId/PartOfName] [Hp]");
            }
			else
			{
                SendClientMessage(playerid, RED, "You cannot use this command.");
		     	return 1;
			}
}
Reply


Messages In This Thread
I need help with /sethealth - by AleckRP - 25.08.2014, 12:18
Re: I need help with /sethealth - by NewbieTester - 25.08.2014, 12:24
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:38
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:46
Re: I need help with /sethealth - by NewbieTester - 25.08.2014, 12:51
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 12:59
Re: I need help with /sethealth - by Stinged - 25.08.2014, 13:07
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 22:40
Re: I need help with /sethealth - by IceCube! - 25.08.2014, 22:46
Re: I need help with /sethealth - by AleckRP - 25.08.2014, 22:53

Forum Jump:


Users browsing this thread: 1 Guest(s)