PDA

View Full Version : "then" but found "{" . Help


Private200
25/01/2013, 07:49 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/market", true))
{
if IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797) // With this line here and the down one
{ // Those lines here
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
return 0;
}
return 1;
}

C:\Documents and Settings\Private\Desktop\New folder\filterscripts\Smoke.pwn(65) : error 001: expected token: "*then", but found "{"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

SilverKiller
25/01/2013, 07:50 PM
Try this

IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797))

DrDoom151
25/01/2013, 07:51 PM
You forgot the brackets :) I think that's it.


public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/market", true))
{
if(IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797)) // With this line here and the down one
{ // Those lines here
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
return 0;
}
return 1;
}

Private200
25/01/2013, 07:52 PM
C:\Documents and Settings\Private\Desktop\New folder\filterscripts\Smoke.pwn(63) : error 001: expected token: "*then", but found ";"
C:\Documents and Settings\Private\Desktop\New folder\filterscripts\Smoke.pwn(63) : error 036: empty statement
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


Probably if i am making an scripting help the solution would not be so easy .

DiGiTaL_AnGeL
25/01/2013, 07:54 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/market", true))
{
if(IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797)) // With this line here and the down one
{ // Those lines here
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You are not at the place!");
}
return 1;
}
return 1;
}
Try this.

Blackazur
25/01/2013, 07:56 PM
Try that:

if(!strcmp(cmdtext, "/market", true))
{
if (IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797))
{
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
return 0;
}

Private200
25/01/2013, 07:56 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/market", true))
{
if(IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797)) // With this line here and the down one
{ // Those lines here
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You are not at the place!");
}
return 1;
}
return 1;
}
Try this.

Still same problem

C:\Documents and Settings\Private\Desktop\New folder\filterscripts\Smoke.pwn(64) : error 001: expected token: "*then", but found "{"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


My code for reminder :

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/market", cmdtext, true, 10) == 0)
{
if IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797)
{
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You are not in any market !");
}
return 1;
}
return 1;
}

Try that:

if(!strcmp(cmdtext, "/market", true))
{
if (IsPlayerInRangeOfPoint(playerid , 2.0, 1067.9446, -892.5276, 43.1797))
{
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "What do you want to buy ?", "Sprunk ($3)\nBeer ($5)\nWine ($10)", "Purchase", "Cancel");
}
return 0;
}


Thanks working . Rep+ :)