SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/11/2017, 02:45 AM   #1
crpJohn
Little Clucker
 
crpJohn's Avatar
 
Join Date: May 2017
Location: Under A Rock
Posts: 10
Reputation: 0
Default Pawno Error... I can't seem to find the issue

I compiled my CnR script I'm working on, and it gave me two errors on one line, it shows the following:

Errors that shows for LINE 297
Code:
error 001: expected token: ";", but found "]"
error 001: expected token: ",", but found "["
LINE 297:
Code:
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
crpJohn is offline   Reply With Quote
Old 15/11/2017, 02:55 AM   #2
Kane
Gangsta
 
Kane's Avatar
 
Join Date: Sep 2012
Posts: 820
Reputation: 125
Default Re: Pawno Error... I can't seem to find the issue

Show the code that's above that line.
__________________
Los Santos Roleplay - Developer
@ls-rp.com

Former Beta Tester

Kane is offline   Reply With Quote
Old 15/11/2017, 04:39 AM   #3
crpJohn
Little Clucker
 
crpJohn's Avatar
 
Join Date: May 2017
Location: Under A Rock
Posts: 10
Reputation: 0
Default Re: Pawno Error... I can't seem to find the issue

Code:
public OnPlayerUpdate(playerid)
{
	SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
^ Line above SetPlayerScore
crpJohn is offline   Reply With Quote
Old 15/11/2017, 04:49 AM   #4
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: Pawno Error... I can't seem to find the issue

You need to show us more lines around this line, That line of code is completely normal and shouldn't give out any errors.
Ritzy2K is offline   Reply With Quote
Old 15/11/2017, 12:34 PM   #5
crpJohn
Little Clucker
 
crpJohn's Avatar
 
Join Date: May 2017
Location: Under A Rock
Posts: 10
Reputation: 0
Default Re: Pawno Error... I can't seem to find the issue

Code:
public OnPlayerUpdate(playerid)
{
	SetPlayerScore(playerid, PlayerInfo[playerid],[pScore]);
	}
	if(gTeam[playerid] == LSPD)
	{
	    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
	}
	    else if(gTeam[playerid] == Criminals)
	{
	    SetPlayerColor(playerid, COLOR_GREEN);
	}
	 else
	 {
	    SetPlayerColor(playerid, COLOR_WHITE);
	    }
	return 1;
}
Whole code beginning to end from OnPlayerUpdate, I really see nothing wrong... Unless I'm missing something?
crpJohn is offline   Reply With Quote
Old 15/11/2017, 12:39 PM   #6
Kane
Gangsta
 
Kane's Avatar
 
Join Date: Sep 2012
Posts: 820
Reputation: 125
Default Re: Pawno Error... I can't seem to find the issue

Highlighted in red unless you did that by accident when you posted the code.

Code:
public OnPlayerUpdate(playerid)
{
	SetPlayerScore(playerid, PlayerInfo[playerid],[pScore]);
	}
	if(gTeam[playerid] == LSPD)
	{
	    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
	}
	    else if(gTeam[playerid] == Criminals)
	{
	    SetPlayerColor(playerid, COLOR_GREEN);
	}
	 else
	 {
	    SetPlayerColor(playerid, COLOR_WHITE);
	    }
	return 1;
}
On another note, I don't recommend using OnPlayerUpdate for this. Seems useless. Set their score and color when they're changed instead of every second.
__________________
Los Santos Roleplay - Developer
@ls-rp.com

Former Beta Tester

Kane is offline   Reply With Quote
Old 15/11/2017, 12:39 PM   #7
BiosMarcel
Banned
 
Join Date: Jul 2012
Location: Germany
Posts: 1,224
Reputation: 234
Default Re: Pawno Error... I can't seem to find the issue

The error lies here:

PHP Code:
SetPlayerScore(playeridPlayerInfo[playerid],[pScore]);

There is a comma and a brace too much.
BiosMarcel is offline   Reply With Quote
Old 15/11/2017, 12:44 PM   #8
crpJohn
Little Clucker
 
crpJohn's Avatar
 
Join Date: May 2017
Location: Under A Rock
Posts: 10
Reputation: 0
Default Re: Pawno Error... I can't seem to find the issue

Code:
public OnPlayerUpdate(playerid)
{
	SetPlayerScore(playerid, PlayerInfo[playerid],[pScore]);
	
	if(gTeam[playerid] == LSPD)
	{
	    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
	}
	    else if(gTeam[playerid] == Criminals)
	{
	    SetPlayerColor(playerid, COLOR_GREEN);
	}
	 else
	 {
	    SetPlayerColor(playerid, COLOR_WHITE);
	    }
	return 1;
}
So I removed the } and yet it still stands
Code:
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
But with extra errors.
crpJohn is offline   Reply With Quote
Old 15/11/2017, 12:48 PM   #9
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,917
Reputation: 258
Default Re: Pawno Error... I can't seem to find the issue

PHP Code:
public OnPlayerUpdate(playerid)
{
    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);

    switch(
gTeam[playerid])
    {
        case 
LSPDSetPlayerColor(playeridCOLOR_LIGHTBLUE);
        case 
CriminalsSetPlayerColor(playeridCOLOR_GREEN);
        default: 
SetPlayerColor(playeridCOLOR_WHITE);
    }
    return 
1;

__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 15/11/2017, 03:54 PM   #10
crpJohn
Little Clucker
 
crpJohn's Avatar
 
Join Date: May 2017
Location: Under A Rock
Posts: 10
Reputation: 0
Default Re: Pawno Error... I can't seem to find the issue

Quote:
Originally Posted by Dayrion View Post
PHP Code:
public OnPlayerUpdate(playerid)
{
    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);

    switch(
gTeam[playerid])
    {
        case 
LSPDSetPlayerColor(playeridCOLOR_LIGHTBLUE);
        case 
CriminalsSetPlayerColor(playeridCOLOR_GREEN);
        default: 
SetPlayerColor(playeridCOLOR_WHITE);
    }
    return 
1;

Gives me the same errors.

EDIT: It has to do with this line only ...
Code:
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
But nothing is wrong with it.

EDIT #2: Fixed the problem, a code was misplaced.
crpJohn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WHAT IS THE ISSUE(pawno error 10) n00blek Scripting Help 5 01/09/2017 02:29 PM
How to find admin cmds in pawno? TheTrue Scripting Help 4 15/04/2015 08:50 PM
Where can I find MTA to pawno cars converter? mysql Help Archive 10 20/02/2010 11:17 PM
[Help]PawnO Find System Danikov Help Archive 1 11/10/2009 06:42 PM


All times are GMT. The time now is 06:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.