Need Script Help
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/setplayerhealth", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth()
		return 1;
	}
	return 0;
}
im tryin to make a sethealth cmd for admins but how would i do it so /setplayerhealth (playerid) (value)
Reply
#2

Quote:
Originally Posted by soldierman
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/setplayerhealth", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth()
		return 1;
	}
	return 0;
}
im tryin to make a sethealth cmd for admins but how would i do it so /setplayerhealth (playerid) (value)
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/setplayerhealth", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth(playerid, 100.0);		
            return 1;
	}
	return 0;
}
Reply
#3

no he wants
/setplayerhealth [id from player ] [ how much his health should be ]
like /setplayerhealth 0 2000
that id 0 health will becomes 2000
Reply
#4

pawn Код:
if(strcmp(cmd, "/sethealth", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sethealth [playerid] [health]");
            return 1;
        }
        new playa;
        new health;
        if(IsStringAName(tmp))
        {
            playa = GetPlayerID(tmp);
        }
        else
        {
            playa = strval(tmp);
        }
        tmp = strtok(cmdtext, idx);
        health = strval(tmp);
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if (IsPlayerConnected)
        {
            SetPlayerHealth(playa, health);
            printf( %s gave %s %d Health",sendername, giveplayer, health);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "
not logged in");
        }
        return 1;
    }
Reply
#5

thanks for help its compiled but ill test after ive done all my admin cmds
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)