SA-MP Forums Archive
A Few Warnings - 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: A Few Warnings (/showthread.php?tid=563366)



A Few Warnings - Jigsaw123 - 15.02.2015

Hey guys... This is my code:

Код:
CMD:buyclothes(playerid, params[])
{
	new string[128];
	new clothes;
	if(!IsPlayerInRangeOfPoint(playerid, 10, 204.3303,-159.8711,1000.5234 || 203.7879,-43.2690,1001.8047 || 206.3741,-8.1265,1001.2109 || 161.5538,-83.7009,1001.8047 || 207.0033,-129.1799,1003.5078))
	return SendClientMessage(playerid, COLOR_ORANGE, "{E5AC00}SERVER: {FFFFFF}You are not at the clothes shop!");
    if(sscanf(params,"i",clothes)) return SendClientMessage(playerid, COLOR_ORANGE, "{E5AC00}SERVER: {FFFFFF}USAGE: /buyclothes [Skin ID]");
    format(string, sizeof(string), "{E5AC00}SERVER:{FFFFFF} You have purchased your clothes.(ID: %d).",clothes);
	SendClientMessage(playerid,COLOR_ORANGE,string);
	GivePlayerMoney(playerid, -100);
	PlayerInfo[playerid][Skin] = clothes;
	SetPlayerSkin(playerid, clothes);
	return 1;
}
and these are the warnings I get and the code doesn't work :/

Код:
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 213: tag mismatch
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
C:\Users\Gabriel\Desktop\Fort Carson Roleplay\gamemodes\roleplay.pwn(7905) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Warnings.



Re: A Few Warnings - nezo2001 - 15.02.2015

which line ?


Re: A Few Warnings - Jigsaw123 - 15.02.2015

Lines 7905:
Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 204.3303,-159.8711,1000.5234 || 203.7879,-43.2690,1001.8047 || 206.3741,-8.1265,1001.2109 || 161.5538,-83.7009,1001.8047 || 207.0033,-129.1799,1003.5078))



Re: A Few Warnings - nezo2001 - 15.02.2015

You forgot the "playerid" after each ||


Re: A Few Warnings - simo0000 - 15.02.2015

try this
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 204.3303,-159.8711,1000.5234) || IsPlayerInRangeOfPoint(playerid,203.7879,-43.2690,1001.8047) || IsPlayerInRangeOfPoint(playerid,206.3741,-8.1265,1001.2109) || IsPlayerInRangeOfPoint(playerid,161.5538,-83.7009,1001.8047) || IsPlayerInRangeOfPoint(playerid,207.0033,-129.1799,1003.5078))
+rep if i helped you


Re: A Few Warnings - AndySedeyn - 15.02.2015

Quote:
Originally Posted by simo0000
Посмотреть сообщение
try this
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 204.3303,-159.8711,1000.5234) || IsPlayerInRangeOfPoint(playerid,203.7879,-43.2690,1001.8047) || IsPlayerInRangeOfPoint(playerid,206.3741,-8.1265,1001.2109) || IsPlayerInRangeOfPoint(playerid,161.5538,-83.7009,1001.8047) || IsPlayerInRangeOfPoint(playerid,207.0033,-129.1799,1003.5078))
+rep if i helped you
That is still not going to work the way he wants it to work. You have to place the exclamation mark before every 'IsPlayerInRangeOfPoint' not just the first one.


Re: A Few Warnings - LazyB0y - 15.02.2015

pawn Код:
#pragma tabsize 0
Try adding that at the top

+rep if I helped you..


Re: A Few Warnings - AndySedeyn - 15.02.2015

Quote:
Originally Posted by LazyBoyyyy
Посмотреть сообщение
pawn Код:
#pragma tabsize 0
Try adding that at the top

+rep if I helped you..
How is that going to solve anything? Way out of context.

It should look like this:
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10, 204.3303,-159.8711,1000.5234) && !IsPlayerInRangeOfPoint(playerid,203.7879,-43.2690,1001.8047) && !IsPlayerInRangeOfPoint(playerid,206.3741,-8.1265,1001.2109) && !IsPlayerInRangeOfPoint(playerid,161.5538,-83.7009,1001.8047) && !IsPlayerInRangeOfPoint(playerid,207.0033,-129.1799,1003.5078))
You are also using the wrong the wrong control structures. This snippet of code will only work when the player is at all these locations at the same moment.


Re: A Few Warnings - LazyB0y - 15.02.2015

Quote:
Originally Posted by Bible
Посмотреть сообщение
How is that going to solve anything? Way out of context.
That is used to remove the warnings for number of arguments doesn't match definition..


Re: A Few Warnings - AndySedeyn - 15.02.2015

Quote:
Originally Posted by LazyBoyyyy
Посмотреть сообщение
That is used to remove the warnings for number of arguments doesn't match definition..
It is still not going to fix any thing other than remove the error message.