SA-MP Forums Archive
Can someone help fix this for me. - 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: Can someone help fix this for me. (/showthread.php?tid=298831)



Can someone help fix this for me. - Jordiee - 22.11.2011

Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(655) : warning 217: loose indentation
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(656) : warning 217: loose indentation
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14874) : error 036: empty statement
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14876) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14878) : error 029: invalid expression, assumed zero
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14882) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Command:
Код:
CMD:garage(playerid, params[]) {
		if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1); {
	 	if(IsPlayerInRangeOfPoint(playerid, 5, -2286.9431,2284.1853,4.9731)
	 		SetPlayerPos(playerid, 1588.7703,-1640.3796,13.1978);
		}
		else {
			SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
		}
	}
	return 1;
}
EDIT: I fixed the warnings, I just now got the errors.


Re: Can someone help fix this for me. - JaTochNietDan - 22.11.2011

You have a semi-colon at the end of an if statement which is not required (2nd line), also please indent your code properly so we can read it (and you can), for example:

pawn Код:
CMD:garage(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, -2286.9431,2284.1853,4.9731)) SetPlayerPos(playerid, 1588.7703,-1640.3796,13.1978);
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}
Now isn't that easier to read and spot your extra brackets and/or missing brackets?


Re: Can someone help fix this for me. - [MG]Dimi - 22.11.2011

PHP код:
CMD:garage(playeridparams[])
{
    if(
groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1);
    {
         if(
IsPlayerInRangeOfPoint(playerid5, -2286.9431,2284.1853,4.9731SetPlayerPos(playerid1588.7703,-1640.3796,13.1978);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"You are not in the PD, Therefore cannot enter the garage.");
    }
    return 
1;

That's for one but between your errors There are 14'200 lines so it's not all on this part of code


Re: Can someone help fix this for me. - Sinc - 22.11.2011

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
PHP код:
CMD:garage(playeridparams[])
{
    if(
groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1);
    {
         if(
IsPlayerInRangeOfPoint(playerid5, -2286.9431,2284.1853,4.9731SetPlayerPos(playerid1588.7703,-1640.3796,13.1978);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"You are not in the PD, Therefore cannot enter the garage.");
    }
    return 
1;

That's for one but between your errors There are 14'200 lines so it's not all on this part of code
Semicolons generally state the end of a statement. The if statement assumes that a statement declared within parenthesis are to be called.


Re: Can someone help fix this for me. - Jordiee - 22.11.2011

Aha yeah it is and I get this error:
Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14877) : error 001: expected token: ")", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Can someone help fix this for me. - JaTochNietDan - 22.11.2011

Sorry the if statement was missing a closing bracket, it should be:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5, -2286.9431,2284.1853,4.9731))



Re: Can someone help fix this for me. - Jordiee - 22.11.2011

it worked but even normal people can enter it :/


Re: Can someone help fix this for me. - Jordiee - 22.11.2011

It's going where the other commands are.


Re: Can someone help fix this for me. - Jordiee - 22.11.2011

So do you know how to make this cops only?
Код:
CMD:garage(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, -2286.9431,2284.1853,4.9731)) SetPlayerPos(playerid, 1588.7703,-1640.3796,13.1978);
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}



Re: Can someone help fix this for me. - Jordiee - 23.11.2011

Citizens can still go in the garage.