SA-MP Forums

Go Back   SA-MP Forums > Non-English > Old Languages Archive > Nederlands/Dutch

 
 
Thread Tools Display Modes
Old 07/05/2012, 06:11 PM   #1
jordyvc
Big Clucker
 
Join Date: Sep 2011
Location: Belgium, Antwerpen
Posts: 167
Reputation: 7
Default AND of ||

Hey,

ik heb deze code:
[CODE]
CMD:wpickup(playerid, params[])// Rebellen wapen pickup command
{

[B]if(IsPlayerInRangeOfPoint(playerid, 10.0,1073.1725,-345.5271,73.9922) || (PlayerInfo[playerid][pTeam] == 1))[/B]
{
ShowPlayerDialog(playerid, WEAPON_DIALOG_1, DIALOG_STYLE_LIST, "Weapon Pickup", "Deagle \nShotgun \nAK-47 \nRPG ", "Select", "Exit");
}
else
{
SendClientMessage(playerid, -1, "Your not at the weapon pickup OR you are not the good team!");
}
return 1;
}[/CODE]

Maar elk team kan wapens kiezen? En normaal moet alleen team 1 deze command kunnen gebruiken als ze in de buurt zijn.

Weet iemand hoe dit kan komen? Ik heb de lijn vet gezet waarvan ik denk dat er iets mis is.

Mvg,
Jordy Van Camp
jordyvc is offline  
Old 07/05/2012, 06:16 PM   #2
Henkie
Godfather
 
Henkie's Avatar
 
Join Date: Oct 2010
Location: North Brabant, The Netherlands
Posts: 5,684
Reputation: 2382
Default Re: AND of ||

|| betekent OF
&& betekent EN

Je zegt nu dus: De player is op de positie, dus krijgt deze het wapen. Als je && gebruikt, moet de player ook in het team zitten ;) Je moet het dus zo doen:

[pawn]
CMD:wpickup(playerid, params[])// Rebellen wapen pickup command
{

if(IsPlayerInRangeOfPoint(playerid, 10.0,1073.1725,-345.5271,73.9922) && (PlayerInfo[playerid][pTeam] == 1))
{
ShowPlayerDialog(playerid, WEAPON_DIALOG_1, DIALOG_STYLE_LIST, "Weapon Pickup", "Deagle \nShotgun \nAK-47 \nRPG ", "Select", "Exit");
}
else
{
SendClientMessage(playerid, -1, "Your not at the weapon pickup OR you are not the good team!");
}
return 1;
}
[/pawn]
Henkie is offline  
Old 07/05/2012, 06:17 PM   #3
jordyvc
Big Clucker
 
Join Date: Sep 2011
Location: Belgium, Antwerpen
Posts: 167
Reputation: 7
Default Re: AND of ||

Ah oke bedankt!!! +REP :D
jordyvc is offline  
Old 07/05/2012, 06:48 PM   #4
[MM]IKKE
Guest
 
Posts: n/a
Default Re: AND of ||

Deze interesseert je misschien wel:
[url]http://forum.sa-mp.com/showpost.php?p=1766742&postcount=51[/url]

Het begin, over short-circuiting.
 
Old 07/05/2012, 07:43 PM   #5
faff
Gangsta
 
Join Date: Mar 2012
Location: Belgium
Posts: 708
Reputation: 11
Default Re: AND of ||

Dit kan ook werken:

[pawn]CMD:wpickup(playerid, params[])// Rebellen wapen pickup command
{

if(IsPlayerInRangeOfPoint(playerid, 10.0,1073.1725,-345.5271,73.9922))
{
if(PlayerInfo[playerid][pTeam] == 1)
{
ShowPlayerDialog(playerid, WEAPON_DIALOG_1, DIALOG_STYLE_LIST, "Weapon Pickup", "Deagle \nShotgun \nAK-47 \nRPG ", "Select", "Exit");
}
else
{
SendClientMessage(playerid, -1, "Your not at the weapon pickup OR you are not the good team!");
}
return 1;
}[/pawn]
__________________
Code:
faff is offline  
Old 07/05/2012, 09:54 PM   #6
BlackBank3
High-roller
 
BlackBank3's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,087
Reputation: 430
Default Re: AND of ||

[quote=faff;1847494]Dit kan ook werken:

[pawn]CMD:wpickup(playerid, params[])// Rebellen wapen pickup command
{

if(IsPlayerInRangeOfPoint(playerid, 10.0,1073.1725,-345.5271,73.9922))
{
if(PlayerInfo[playerid][pTeam] == 1)
{
ShowPlayerDialog(playerid, WEAPON_DIALOG_1, DIALOG_STYLE_LIST, "Weapon Pickup", "Deagle \nShotgun \nAK-47 \nRPG ", "Select", "Exit");
}
else
{
SendClientMessage(playerid, -1, "Your not at the weapon pickup OR you are not the good team!");
}
return 1;
}[/pawn][/quote]
Daarbij zul je een error verwachten, omdat je een bracket bent vergeten...

Waarom post je dit, als je er zelf geen bal van snapt?
BlackBank3 is online now  
Old 08/05/2012, 07:15 AM   #7
Biesmen
High-roller
 
Biesmen's Avatar
 
Join Date: May 2009
Posts: 1,894
Reputation: 665
Default Re: AND of ||

[quote=BlackBank3;1847789]
Waarom post je dit, als je er zelf geen bal van snapt?[/quote]
Post count, en mensen die het leuk vinden om zichzelf voor schut te zetten.
Biesmen is offline  
Old 07/05/2012, 10:17 PM   #8
[MM]IKKE
Guest
 
Posts: n/a
Default Re: AND of ||

Trouwens, Grammar Nazi.

Het is "You're not at the weapon pickup"

Ik denk dat deze fout wel belangrijk is, aangezien je je server waarschijnlijk wel een professionele look wilt geven?
 
Old 08/05/2012, 03:56 PM   #9
sjvt
Banned
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 989
Reputation: 60
Default Re: AND of ||

Wat BlackBank3 zeg, en je verbruikt onnodige lines. Waarom moeilijk doen als het super simpel kan..
sjvt is offline  
Old 08/05/2012, 07:01 PM   #10
legodude
High-roller
 
legodude's Avatar
 
Join Date: Sep 2009
Location: 127.0.0.1 duhh
Posts: 1,150
Reputation: 783
Default Re: AND of ||

vooral post count waarschijnlijk 200 posts en niet een rep. kan weinig goeds zijn me dunkt..

[url]http://wiki.sa-mp.com/wiki/Scripting_Basics_NL#Condities[/url] is misschien ook een must-read ;)
__________________
legodude is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Off
Smilies are Off
[IMG] code is Off
HTML code is Off



All times are GMT. The time now is 12:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.