Questions
#1

I have some questions about giving money to all team etc ...

i try when player complete the mission it type gametextforplayer to all of COP_TEAM and and other Gametextforplayer to all of GROVE_TEAM

here is the code what i want and ask if this will work , cuz i have felling it wont work

Код:
GameTextForPlayer(TEAM_GROVE,"Mission Passed!~n~~g~+7500$",5000,0);
	GivePlayerMoney(TEAM_GROVE,7500);
will this give the money to all team and send game text to all team ? can you help ? if not what should i fix and do

ty
Reply
#2

It's something like this if you're using GetPlayerTeam-function:
pawn Код:
foreach(Player, u)
{
  if(GetPlayerTeam(u) == TEAM_GROVE)
  {
    GameTextForPlayer(u, "Mission Passed!~n~~g~+7500$", 5000, 0);
    GivePlayerMoney(u, 7500);
  }
}
or like this if you're using gTeam or any other variable:
pawn Код:
foreach(Player, u)
{
  if(gTeam[u] == TEAM_GROVE)
  {
    GameTextForPlayer(u, "Mission Passed!~n~~g~+7500$", 5000, 0);
    GivePlayerMoney(u, 7500);
  }
}
You'll also need ******'s foreach-function.
Reply
#3

Quote:
Originally Posted by Don Correlli
It's something like this if you're using GetPlayerTeam-function:
pawn Код:
foreach(Player, u)
{
  if(GetPlayerTeam(u) == TEAM_GROVE)
  {
    GameTextForPlayer(u, "Mission Passed!~n~~g~+7500$", 5000, 0);
    GivePlayerMoney(u, 7500);
  }
}
or like this if you're using gTeam or any other variable:
pawn Код:
foreach(Player, u)
{
  if(gTeam[u] == TEAM_GROVE)
  {
    GameTextForPlayer(u, "Mission Passed!~n~~g~+7500$", 5000, 0);
    GivePlayerMoney(u, 7500);
  }
}
You'll also need ******'s foreach-function.
hvala, i just want to ask you coreli is this as include ? or what i think its include let me try
Reply
#4

Quote:
Originally Posted by Lajko1
hvala, i just want to ask you coreli is this as include ? or what i think its include let me try
Yes, it is - you need to include it in your script:
pawn Код:
#include <foreach>
Reply
#5

ammm

Код:
C:\Documents and Settings\samp\Desktop\Server2\gamemodes\Jefferson.pwn(5) : fatal error 100: cannot read from file: "foreach"
Top of my script

Код:
#include <foreach>
and i copy and past from link what u post me coreli i past in notepad name it ''foreach'' and palce in pawno include , and i get this error that i post what should be wrong ?
Reply
#6

Make sure you have foreach.inc in the \pawno\include\ folder of the PAWNO IDE you're using.
Reply
#7

ok i place now this function and works OK no errors for now now i must just get a friend to say him if we can test if it works and i will tell anyway ty
Reply
#8

You're welcome.

I suggest you to use foreach from now on, it's faster than normal for-player-loop.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)