a little help.
#1

I am trying to add a new IsPlayerInRageOfPoint in one line when i did that i get 2 or 3 errors.

Код:
											// LSPD                                                     	// SASD
	if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89) || if(IsPlayerInRangeOfPoint(playerid, 283, 613.8015, -589.0556,17.2330,268.7866 || return SendClientMessage(playerid, -1, "You are not at the arrest point.");
Код:
C:\Users\Brandon\Desktop\Generation X Gaming\gamemodes\GXGNEW.pwn(1942) : warning 202: number of arguments does not match definition
C:\Users\Brandon\Desktop\Generation X Gaming\gamemodes\GXGNEW.pwn(5439) : error 029: invalid expression, assumed zero
C:\Users\Brandon\Desktop\Generation X Gaming\gamemodes\GXGNEW.pwn(5439) : error 029: invalid expression, assumed zero
C:\Users\Brandon\Desktop\Generation X Gaming\gamemodes\GXGNEW.pwn(7803) : warning 213: tag mismatch
C:\Users\Brandon\Desktop\Generation X Gaming\gamemodes\GXGNEW.pwn(7803) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664
Reply
#2

Try the following:
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89) || !IsPlayerInRangeOfPoint(playerid, 10, 613.8015, -589.0556,17.2330,268.7866))
    return SendClientMessage(playerid, -1, "You are not at the arrest point.");
Edited because I had not noticed I had forgot one ")"
Reply
#3

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89) || !IsPlayerInRangeOfPoint(playerid, 10, 613.8015, -589.0556,17.2330)) return SendClientMessage(playerid, -1, "You are not at the arrest point.");
You cannot have an if inside if like that:
pawn Код:
if( something || if( something2 ) )
// Not correct
And instead of closing the parentheses and return an error message, you use "||".

Anyways, the last IsPlayerInRangeOfPoint was a bit.. 4 parameters (x, y, z, angle) and I think the previous parameter was skin instead of the range. I suppose it's if he's not in that range the second as well.
Reply
#4

The line should be:

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89) || !IsPlayerInRangeOfPoint(playerid, 283, 613.8015, -589.0556,17.2330,268.7866 return SendClientMessage(playerid, -1, "You are not at the arrest point.");
Reply
#5

Quote:
Originally Posted by arjanforgames
Посмотреть сообщение
The line should be:

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89) || !IsPlayerInRangeOfPoint(playerid, 283, 613.8015, -589.0556,17.2330,268.7866 return SendClientMessage(playerid, -1, "You are not at the arrest point.");
Still incorrect. You do not close the parentheses for the if statement and it finds "return" instead of ")".
Reply
#6

am sure you can have it on one line with ||

Anyways thanks for the help guys much helpful.
Reply
#7

Quote:
Originally Posted by Yves
Посмотреть сообщение
am sure you can have it on one line with ||
Yes you can have in one line with || Inside a statement. Not outside and return a value after that.

This is what you did.
pawn Код:
if( something || something2 || return Error();
// ERRORS
Reply
#8

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Yes you can have in one line with || Inside a statement. Not outside and return a value after that.

This is what you did.
pawn Код:
if( something || something2 || return Error();
// ERRORS
i see thanks alot tho mate. at least i know now just learning something everyday
Reply
#9

You cannot put || then return a client message.
You must close the if( ..code..) then return a message.
Hope you see the idea of this
Reply
#10

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
You cannot put || then return a client message.
You must close the if( ..code..) then return a message.
Hope you see the idea of this
yeah i know that thanks tho
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)