SA-MP Forums

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

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

Hey,

ik heb deze code:
Code:
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;
}
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   Reply With Quote
Old 07/05/2012, 06:16 PM   #2
Henkie
High-roller
 
Henkie's Avatar
 
Join Date: Oct 2010
Location: North Brabant, The Netherlands
Posts: 1,377
Reputation: 1825
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 Code:
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;
}
Henkie is offline   Reply With Quote
Old 07/05/2012, 06:17 PM   #3
jordyvc
Big Clucker
 
Join Date: Sep 2011
Location: Belgium, Antwerpen
Posts: 168
Reputation: 7
Default Re: AND of ||

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

Deze interesseert je misschien wel:
http://forum.sa-mp.com/showpost.php?...2&postcount=51

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

Dit kan ook werken:

pawn Code:
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;
}
__________________
Code:
faff is offline   Reply With Quote
Old 07/05/2012, 09:54 PM   #6
BlackBank3
Gangsta
 
BlackBank3's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 849
Reputation: 427
Default Re: AND of ||

Quote:
Originally Posted by faff View Post
Dit kan ook werken:

pawn Code:
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;
}
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 offline   Reply With Quote
Old 08/05/2012, 07:15 AM   #7
Biesmen
High-roller
 
Biesmen's Avatar
 
Join Date: May 2009
Posts: 1,625
Reputation: 637
Default Re: AND of ||

Quote:
Originally Posted by BlackBank3 View Post
Waarom post je dit, als je er zelf geen bal van snapt?
Post count, en mensen die het leuk vinden om zichzelf voor schut te zetten.
Biesmen is offline   Reply With Quote
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?
  Reply With Quote
Old 08/05/2012, 03:56 PM   #9
sjvt
Gangsta
 
sjvt's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 667
Reputation: 36
Default Re: AND of ||

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

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

http://wiki.sa-mp.com/wiki/Scripting...s_NL#Condities is misschien ook een must-read
__________________
legodude is offline   Reply With Quote
Reply

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 On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:57 PM.


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