SA-MP Forums Archive
Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Errors (/showthread.php?tid=146011)



Errors - juuleman - 05.05.2010

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



Re: Errors - Torran - 05.05.2010

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



Re: Errors - juuleman - 05.05.2010

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



Re: Errors - Torran - 05.05.2010

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);
}
}



Re: Errors - juuleman - 05.05.2010

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;
}



Re: Errors - Torran - 05.05.2010

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


Re: Errors - Simon - 05.05.2010

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 ...


Re: Errors - juuleman - 05.05.2010

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.


Re: Errors - geerdinho8 - 05.05.2010

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


Re: Errors - juuleman - 05.05.2010

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