Errors
#1

Whats wrong with this?:

pawn Код:
GivePlayerMoney(GetPlayerTeam == 2,100);
    SetPlayerScore(GetPlayerTeam == 2, GetPlayerScore(GetPlayerTeam == 2) + 1);
Getting these errors:

Код:
(377) : error 076: syntax error in the expression, or invalid function call
(378) : error 076: syntax error in the expression, or invalid function call
Reply
#2

pawn Код:
GivePlayerMoney(GetPlayerTeam(playerid) == 2), 100);
SetPlayerScore(GetPlayerTeam(playerid) == 2), GetPlayerScore(GetPlayerTeam(playerid) == 2) + 1);
Reply
#3

Now i get even more errors:

Код:
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(377) : warning 202: number of arguments does not match definition
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(377) : warning 215: expression has no effect
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(377) : error 001: expected token: ";", but found ")"
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(377) : error 029: invalid expression, assumed zero
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(377) : warning 215: expression has no effect
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(378) : warning 202: number of arguments does not match definition
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(378) : warning 215: expression has no effect
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(378) : error 001: expected token: ";", but found ")"
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(378) : error 029: invalid expression, assumed zero
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(378) : warning 215: expression has no effect
Reply
#4

Show the lines

EDIT: Do it this way its alot better

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == 2)
{
GivePlayerMoney(i, 100);
SetPlayerScore(i, GetPlayerScore(i) +1);
}
}
Reply
#5

Its in a timer:

pawn Код:
public bombtimer12(playerid)
{
    CreateExplosion(277.3107,-1435.0239,13.9255,6,10.0);
    GameTextForAll("~r~Red~w~ Team won!",5000,5);
    GivePlayerMoney(GetPlayerTeam(playerid) == 2), 100);
  SetPlayerScore(GetPlayerTeam(playerid) == 2), GetPlayerScore(GetPlayerTeam(playerid) == 2) + 1);
    return 1;
}
Reply
#6

Your codes confusing me, I posted a different and more understandable away above your post
Reply
#7

So you want to give players 0 and 1 (if Team 2 is valid) $100 and set the players score to player 0 or 1's score and add one? Yeah, something tells me just because it's now compileable code that it won't do what you want.

Read the Pawn Language guide. You should learn how to script before editing scripts ...
Reply
#8

Thanks Torran,

I now got this:

pawn Код:
public bombtimer12(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
  if(GetPlayerTeam(i) == 2)
  {
    GivePlayerMoney(i, 100);
    SetPlayerScore(i, GetPlayerScore(i) +1);
  }
    CreateExplosion(277.3107,-1435.0239,13.9255,6,10.0);
    GameTextForAll("~r~Red~w~ Team won!",5000,5);
    return 1;
}
}
Only 1 error (Will be easy i think):

Код:
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\Test Server\samp03asvr_R4_win32\gamemodes\MGS\Blow up the Restaurant.pwn(386) : warning 209: function "bombtimer12" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Oh and Simon i dont edit a script, its mine.
Reply
#9

pawn Код:
public bombtimer12(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
  if(GetPlayerTeam(i) == 2)
  {
    GivePlayerMoney(i, 100);
    SetPlayerScore(i, GetPlayerScore(i) +1);
  }
CreateExplosion(277.3107,-1435.0239,13.9255,6,10.0);
GameTextForAll("~r~Red~w~ Team won!",5000,5);
}
return 1;
}
BTW it's a warning xD
Reply
#10

Quote:
Originally Posted by Sigiamix
pawn Код:
public bombtimer12(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
  if(GetPlayerTeam(i) == 2)
  {
    GivePlayerMoney(i, 100);
    SetPlayerScore(i, GetPlayerScore(i) +1);
  }
CreateExplosion(277.3107,-1435.0239,13.9255,6,10.0);
GameTextForAll("~r~Red~w~ Team won!",5000,5);
}
return 1;
}
BTW it's a warning xD
I know lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)