Caps Lock +rep
#1

Ok,

Why when i do
" /buyweapon eagle" the command works!
`But when i do this
"/buyweapon Eagle" The command don't work.

Please tell me how to make the command works on both cases

+Rep if you helped me
Reply
#2

What command processor are you using?

Anyways you still can't give +REP, so don't be saying that in posts.
Reply
#3

You're going to want to use the Boolean ignorecase with strcmp.

https://sampwiki.blast.hk/wiki/Strcmp

That's about all I can tell you with the lack of information provided.
Reply
#4

@Onfroi

STRCMP

@RVMP
Ye, thanks but can you teach me how please? Cuase Wiki don't really explain good..
Or where to put this
Quote:

strcmp(stringfromvariable, stringfromtextfile, true/false, strlen(stringfromvariable))

Reply
#5

Quote:
Originally Posted by Eliminator
Посмотреть сообщение
@Onfroi

STRCMP

@RVMP
Ye, thanks but can you teach me how please? Cuase Wiki don't really explain good..
Or where to put this
If you are using strcmp, then like I said just change the 'false' to 'true' that you see on the line. If you can't find it, post the entire command here and I'll change it for you.
Reply
#6

PHP код:
if(!strcmp("/buyweapon combat",cmdtext))
{
    if(
IsPlayerInRangeOfPoint(playerid7.0,294.9563,-38.5114,1001.5156 ))
    {
        
SendClientMessage(playerid,0xAFAFAFAA,"You have Buyed Combat Shotgun");
        
GivePlayerMoney(playerid,-1000);
        
GivePlayerWeapon(playerid,27,100);
    }
    return 
1;

Reply
#7

pawn Код:
if(!strcmp("/buyweapon combat",cmdtext, true))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0,294.9563,-38.5114,1001.5156 ))
    {
        SendClientMessage(playerid,0xAFAFAFAA,"You have Buyed Combat Shotgun");
        GivePlayerMoney(playerid,-1000);
        GivePlayerWeapon(playerid,27,100);
    }
    return 1;
}
Will now allow 'eagle' to be the same thing as 'EaGlE'. You will need to do this for any commands which you do NOT wish to be case sensitive.
Reply
#8

pawn Код:
if(!strcmp("/buyweapon combat",cmdtext,true))
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0,294.9563,-38.5114,1001.5156 ))
    {
        SendClientMessage(playerid,0xAFAFAFAA,"You have Buyed Combat Shotgun");
        GivePlayerMoney(playerid,-1000);
        GivePlayerWeapon(playerid,27,100);
    }
    return 1;
}
Reply
#9

@RVRP

Thanks ^_^

@tyler12

Thanks,but can't give Rep,Max of the day
Reply
#10

Okay, to avoid the Uppercase-Lowercase mistake, use the Boolean script (you will find it in WIKI) or
Avoid using Uppercase-Lowercase letters.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)