#1

hi

i have a question.
i would make a /mission command.
when he type /mission he must kill id 0.
when he kill id 0, he have the mission complete.

when he is id 0, than he dont can do the mission

srry for my bad english.
Reply
#2

if(playerid == 0)
{
SendClientMessage(playerid, 0xFF00FFAA, "You are ID 0, so there's no point trying to kill ID 0!");
}
Reply
#3

ok thx, but how can i make, that the player kill id 0?
Reply
#4

Well any player can kill any other player regardless of what command they type.. If you just want it to tell them what to do:

pawn Код:
if(strcmp(cmdtext, "/mission", true) == 0)
    {
    if(playerid == 0)
      {
      SendClientMessage(playerid, 0xFF00FFAA, "You are ID 0, so there's no point trying to kill ID 0!");
      }
    else if(!IsPlayerConnected(0))
      {
      SendClientMessage(playerid, 0xFF00FFAA, "ID 0 is not connected!");
      }
    else
      {
      new
        Name[MAX_PLAYER_NAME],
        string[100];
      GetPlayerName(0, Name, sizeof(Name));
      format(string, sizeof(string), "Go and kill %s", Name);
      SendClientMessage(playerid, 0xFF00FFAA, string);
      }
    return 1;
    }
But it's fairly pointless
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if( ) //killerid is on mission
{
if(playerid == 0)
{
   //What will happend if the player finishes the mission
}
}
    return 1;
}
Reply
#6

How about IsPlayerConnected?
Reply
#7

Quote:
Originally Posted by Mikep
How about IsPlayerConnected?
Altered
Reply
#8

Quote:
Originally Posted by Weirdosport
But it's fairly pointless
hmm, i think so:

a player make a mission that he kill a player.

its bether when he kill a random id that connect.

but this is work, i've test it.

well its better when he kill a random player.
Reply
#9

Quote:
Originally Posted by Headshot1108
Quote:
Originally Posted by Weirdosport
But it's fairly pointless
hmm, i think so:

a player make a mission that he kill a player.

its bether when he kill a random id that connect.

but this is work, i've test it.

well its better when he kill a random player.
You could put the random bit in yourself, but that'd take alot more effort and i'm not here to script for you. I will direct you towards the following:

Random
Reply
#10

Here:

pawn Код:
new HuntID[MAX_PLAYERS];
new IsHunting[MAX_PLAYERS];

OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/mission", true))
    {
        new
            Msg[19];
        HuntID[playerid] = random(GetMaxPlayers());
        while(HuntID[playerid] == playerid || !IsPlayerConnected(HuntID[playerid])) HuntID[playerid] = random(GetMaxPlayers());
        format(Msg, 19, "You are now hunting for ID %i.", HuntID[playerid]);
        SendClientMessage(playerid, 0xFFFF00FF, Msg);
        IsHunting[playerid] = 1;
        return 1;
    }
    return 0;
}

OnPlayerDeath(playerid, killerid, reason)
{
    if(IsHunting[killerid] == 1 && HuntID[killerid] == playerid)
    {
        SendClientMessage(killer, 0xFFFF00FF, "You have successfully carried out the mission and have been awarded $5000!");
        GivePlayerMoney(killerid, 5000);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)