Smail help +Rep
#21

Quote:
Originally Posted by astanalol
View Post
new errors in it again
if(PlayerInfo[playerid][pRank] >= 7 && PlayerInfo[playerid][pRank] =< 8 )

Change that, it was => when it should've been >=.


Quote:
Originally Posted by UltraScripter
View Post
yeah ok...
Quote:
Originally Posted by 1fret
View Post
pawn Code:
if(PlayerInfo[playerid][pRank] >= 2)
try this man. It wll only work for level two and higher.
Please tell me you haven't repped these fools already...
Reply
#22

pawn Code:
if(PlayerInfo[playerid][pRank] >= 2 && PlayerInfo[playerid][pRank] < 9)
{
    // codes
}
else
{
    SendClientMessage(playerid, -1, "You ate not prank 2-8.");
}
Using to 2-8.
Reply
#23

Quote:
Originally Posted by JuanStone
View Post
pawn Code:
if(PlayerInfo[playerid][pRank] >= 2 && PlayerInfo[playeri][pRank] < 9)
Use the <= for a definitive "hit" on the right value...
Reply
#24

JuanStone, indeeds shows the correct way of doing this. Let me explain what using || will do:

- It will allow if there rank is higher than 2.
- It will allow if there rank is lower than 9.

He wants it to just be 2-8, not 2+ and lower than 9.
Reply
#25

Quote:
Originally Posted by Abagail
View Post
JuanStone, indeeds shows the correct way of doing this. Let me explain what using || will do:

- It will allow if there rank is higher than 2.
- It will allow if there rank is lower than 9.

He wants it to just be 2-8, not 2+ and lower than 9.
If I threw in a level of 12 into the || formula, it's higher than 2 so it will confirm.....

Same with the lower than 9, It'll work no matter what with ||... lol...

Should also be =< 8 rather than <9 just to make it a definitive match.


Now where the heck is my +rep, and I sure as heck hope you haven't +reped anyone else in here in haste to get a pastable code-snippet to simply paste in...
Reply
#26

I am pointing out the mistake; not something that works. And; REP really doesn't matter; after getting 15 it's just a number(thats really all it becomes).
Reply
#27

Quote:
Originally Posted by Abagail
View Post
I am pointing out the mistake; not something that works. And; REP really doesn't matter; after getting 15 it's just a number(thats really all it becomes).
The fact that people with rep make this plain out simple mistake shows rep is given where it's not deserved...


Especially when it's pasted as code for someone to copy and paste into their buggy script, only for it to turn up again later when they ask about another bug.



And yet they're simply +repping for what? A fix with an inherent problem, and because they didn't make the script, when it bugs out noticably, they come back, and make another "help" thread.
Reply
#28

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
pawn Код:
if(PlayerInfo[playerid][pRank] => 2)  if(PlayerInfo[playerid][pRank] =< 8)
{

}
This is not how you add checks
pawn Код:
if(PlayerInfo[playerid][pRank] => 2 && PlayerInfo[playerid][pRank] =< 8) {}
To have two or more checks you just need to add the conditional statement inside the brackets () and seperate each with OR or AND gates.

AND gate is &&
OR gate is ||

Quote:
Originally Posted by astanalol
Посмотреть сообщение
this line 1306 and 1307
PHP код:
    } else SendClientMessage(playerid, -1"Sorry , you are not admin");
    return 
1
all cmd
PHP код:
CMD:setrank(playeridparams[])
{
    new 
str[128], ARanklookupid;
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
    {
        if(
sscanf(params"ui"lookupidARank)) return SendClientMessage(playerid, -1"Usage: /setrank <PlayerID/PlayerName> <Rank>");
        
format(strsizeof(str), "Admin %s (ID:%d) has setted %s (ID:%d) Rank to (%d)",GetName(playerid), playeridGetName(lookupid), lookupidARank);
        
SendClientMessageToAll(-1str);
        
PlayerInfo[lookupid][pRank] = ARank;
    }
    } else 
SendClientMessage(playerid, -1"Sorry , you are not admin");
    return 
1;

You have extra closing bracket }
Reply
#29

Quote:
Originally Posted by UltraScripter
View Post
you can use || too
No, you can't. Why?

Because || is bassicly 'or'.

It bassicly says, if 'this statement' /OR/ 'this statement' is true, proceed.
Else-.. Do whatever you want.

And && is bassicly 'AND', if 'this statement' /AND/ 'this statement' are true, proceed.
Else-.. Do whatever you want.

And if he would've used || it would've been if the player's rank is 8<= or >= 2 proceed.
And if you used && it would've check if the player's rank is inbetween 2 and 8.
Therefore you can't use ||, techincally you can but it isn't what he wants.
Reply
#30

PHP Code:
CMD:setrank(playeridparams[]) 

    new 
str[128], ARanklookupid
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8
    { 
        if(
sscanf(params"ui"lookupidARank)) return SendClientMessage(playerid, -1"Usage: /setrank <PlayerID/PlayerName> <Rank>"); 
        
format(strsizeof(str), "Admin %s (ID:%d) has setted %s (ID:%d) Rank to (%d)",GetName(playerid), playeridGetName(lookupid), lookupidARank); 
        
SendClientMessageToAll(-1str); 
        
PlayerInfo[lookupid][pRank] = ARank
    } 
    else 
SendClientMessage(playerid, -1"Sorry , you are not admin"); 
    return 
1

Reply
#31

Quote:
Originally Posted by Stuun23
View Post
PHP Code:
CMD:setrank(playeridparams[]) 

    new 
str[128], ARanklookupid
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8
    { 
        if(
sscanf(params"ui"lookupidARank)) return SendClientMessage(playerid, -1"Usage: /setrank <PlayerID/PlayerName> <Rank>"); 
        
format(strsizeof(str), "Admin %s (ID:%d) has setted %s (ID:%d) Rank to (%d)",GetName(playerid), playeridGetName(lookupid), lookupidARank); 
        
SendClientMessageToAll(-1str); 
        
PlayerInfo[lookupid][pRank] = ARank
    } 
    else 
SendClientMessage(playerid, -1"Sorry , you are not admin"); 
    return 
1

Fixed Alot Of Thanks
+Rep
Reply
#32

Quote:
Originally Posted by Kaperstone
View Post
Fixed

So ?
and u too +rep for try Hard with me
thx
Reply
#33

And this is why copying and pasting code to people isn't good... Even with the answers right in front of him on the console, he still wouldn't debug his own code, simply pasting it here expecting, yet again, for someone to fix it........
Reply
#34

Quote:
Originally Posted by UltraScripter
View Post
you can use || too
What your suggesting Sew_Sumi wouldn't work seen as the system would get confused and thing the "Client" has two values set to their Admin rank, but UltraScripter did give a correct solution is is a much better scripter than you Sew_Sumi seen as you've given something as a 'solution' that wouldn't work out-right.


Example:
pawn Code:
if(AccountInformation[playerid][AccountAdminRank] >= 1 || AccountInformation[playerid][AccountHelperRank] >= 1)
Reply
#35

It goes like this.

if (variable >= 1 && variable <= 8 )
Reply
#36

Quote:
Originally Posted by zT KiNgKoNg
View Post
What your suggesting Sew_Sumi wouldn't work seen as the system would get confused and thing the "Client" has two values set to their Admin rank, but UltraScripter did give a correct solution is is a much better scripter than you Sew_Sumi seen as you've given something as a 'solution' that wouldn't work out-right.


Example:
pawn Code:
if(AccountInformation[playerid][AccountAdminRank] >= 1 || AccountInformation[playerid][AccountHelperRank] >= 1)
LOL, Go back to reading the damn guide then... I'm correct and what I've stated all along is true...

If you can't understand >= and <= then you obviously have no capability to be judging who is the better scripter, not that it's a fucking challenge... Not that you, or UltraScripter would be much challenge, fact is, that you both obviously don't understand Pawn in the slightest.

Rather than having one "hit", I'd prefer 2, to be "sure" that I'm getting the right value... If you prefer to use ||, then go ahead, but don't cry when the results fuck up on you...

As for the confused system, you're talking out your ass, and as for UltraScripter being a better scripter, ROFL......... Just last month "Ultra Scripter" was inserting Else statements where ever the fuck he liked without even making the required opening if statements...

But that's alright though, obviously you know how good he can script by the fact that he put 2 if statements on one line earlier on in the thread...



So where's your scripting examples mate... STFU and GTFO...


Quote:
Originally Posted by Turn
View Post
It goes like this.

if (variable >= 1 && variable <= 8 )
Exactly....



And with that, this thread, can be closed...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)