HELP With some errors
#1

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;

}
Reply
#2

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

Dinero = GetPlayerMoney(playerid); < this is missing

}
Reply
#3

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;

Reply
#4

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.
Reply
#5

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;

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)