SA-MP Forums Archive
HELP With some 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)
+--- Thread: HELP With some errors (/showthread.php?tid=660350)



HELP With some errors - FrancoBello - 01.11.2018

Hello, My problem is this, if someone helps me, it would be very helpful

PS: I'm very new in this

These are the errors:

Code:
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(542) : error 001: expected token: ";", but found "("
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(546) : error 028: invalid subscript (not an array or too many subscripts): "Dinero"
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(546) : warning 215: expression has no effect
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(546) : error 001: expected token: ";", but found "]"
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(546) : error 029: invalid expression, assumed zero
C:\Users\Franco\Desktop\proyecto samp\gamemodes\grandlarc.pwn(546) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
And these are the lines:

Code:
Dinero(playerid, Dinero) //542 line
{
	new
	
		Dinero = GetPlayerMoney(playerid)
	
}

COMMAND:dinero(playerid,params[]) //546 line
{
	if(Dinero[playerid] <= 0);
	{
	GivePlayerMoney(playerid, 100000);
	SendClientMessage(playerid, COLOR_BLUE, "ЎDisfruta del dinero!");
	}
	else (Dinero[playerid] >= 2);
	SendClientMessage(playerid, COLOR_RED, "ЎTu ya tienes dinero!");
	return 1;

}



Re: HELP With some errors - Mobtiesgangsa - 01.11.2018

Dinero(playerid, Dinero) //542 line
{
new

Dinero = GetPlayerMoney(playerid); < this is missing

}


Re: HELP With some errors - IceBilizard - 01.11.2018

1 question why you are using this code for getting player cash?

PHP Code:
Dinero(playeridDinero//542 line
{
    new
    
        
Dinero GetPlayerMoney(playerid)
    

You can define in command directly like this

PHP Code:

COMMAND
:dinero(playerid,params[]) //546 line
{
    if(
GetPlayerMoney(playerid) <= 0);
    {
                    
GivePlayerMoney(playerid100000);
                    
SendClientMessage(playeridCOLOR_BLUE"ЎDisfruta del dinero!");
    }
    else (
GetPlayerNoney(playerid) >= 2);
    
SendClientMessage(playeridCOLOR_RED"ЎTu ya tienes dinero!");
    return 
1;




Re: HELP With some errors - GTLS - 01.11.2018

Quote:
Originally Posted by IceBilizard
View Post
1 question why you are using this code for getting player cash?

You can define in command directly like this

Code:
COMMAND:dinero(playerid,params[]) //546 line
{
	if(GetPlayerMoney(playerid) <= 0);
	{
 	               GivePlayerMoney(playerid, 100000);
 	               SendClientMessage(playerid, COLOR_BLUE, "ЎDisfruta del dinero!");
	}
	else if(GetPlayerNoney(playerid) >= 2);
	SendClientMessage(playerid, COLOR_RED, "ЎTu ya tienes dinero!");
	return 1;

}
If statements and else statements doesnt have semi-colen. Remove those.
And you can not directly use condition in else, you have to use else if. Add if there.


Re: HELP With some errors - UFF - 01.11.2018

pawn Code:
COMMAND:dinero(playerid,params[])
{
       new money = GetPlayerMoney(playerid);
    if(money <= 0)
    {
      GivePlayerMoney(playerid, 100000);
      SendClientMessage(playerid, COLOR_BLUE, "ЎDisfruta del dinero!");
    }
    else if(money >= 2)
       {
          SendClientMessage(playerid, COLOR_RED, "ЎTu ya tienes dinero!");
        }
    return 1;

}