3 Problems[rep]
#1

i made 3 cmds..but i type for /refill and /repair and it says.. You are not a Car Mechanic and i made myself car mechanic..No errors

PHP код:
if(strcmp(cmd"/refill"true) == 0)
        {
        if(
IsPlayerConnected(playerid))
        {
        if (
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
        {
        
SendClientMessage(playeridCOLOR_GREY"   You are not a Car Mechanic!");
            return 
1;
        }
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /refill [playerid/PartOfName] [price]");
            return 
1;
        }
        new 
playa;
        new 
money;
        
playa ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
        
money strval(tmp);
        if(
money || money 2000) { SendClientMessage(playeridCOLOR_GREY"   Price not lower then 1, or above 2000!"); return 1; }
        if(
IsPlayerConnected(playa))
        {
            if(
playa != INVALID_PLAYER_ID)
            {
                if(
ProxDetectorS(8.0playeridplaya)&& IsPlayerInAnyVehicle(playa))
                {
                    if(
playa == playerid) { SendClientMessage(playeridCOLOR_GREY"   Can't do that!"); return 1; }
                    
GetPlayerName(playagiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* You offerd %s to refill his car for $%d .",giveplayer,money);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* Car Mechanic %s wants to refill your car for $%d, (type /accept refill) to accept.",sendername,money);
                    
SendClientMessage(playaCOLOR_LIGHTBLUEstring);
                    
RefillOffer[playa] = playerid;
                    
RefillPrice[playa] = money;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   That player is not near you / not in a car.");
                }
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"   That player is offline.");
        }
        }
        return 
1;
        }
        if(
strcmp(cmd"/repair"true) == 0)
        {
        if(
IsPlayerConnected(playerid))
        {
        if (
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
        {
            
SendClientMessage(playeridCOLOR_GREY"   You are not a Car Mechanic!");
            return 
1;
        }
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /repair [playerid/PartOfName] [price]");
            return 
1;
        }
        new 
playa;
        new 
money;
        
playa ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
        
money strval(tmp);
        if(
money || money 2000) { SendClientMessage(playeridCOLOR_GREY"   Price not lower then 1, or above 2000!"); return 1; }
        if(
IsPlayerConnected(playa))
        {
            if(
playa != INVALID_PLAYER_ID)
            {
                if(
ProxDetectorS(8.0playeridplaya)&& IsPlayerInAnyVehicle(playa))
                {
                    if(
playa == playerid) { SendClientMessage(playeridCOLOR_GREY"   Can't do that!"); return 1; }
                    
GetPlayerName(playagiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* You offerd %s to fix his car for $%d .",giveplayer,money);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* Car Mechanic %s wants to repair your car for $%d, (type /accept repair) to accept.",sendername,money);
                    
SendClientMessage(playaCOLOR_LIGHTBLUEstring);
                    
RepairOffer[playa] = playerid;
                    
RepairPrice[playa] = money;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   That player is not near you / not in a car.");
                }
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"   That player is offline.");
        }
        }
        return 
1;
        } 
i put /tc and nothing happens../tc is for chating with other mechanics..only mechanics giving rep to all

PHP код:
  if(strcmp(cmd"/tc"true) == 0)
        {
        if(
IsPlayerConnected(playerid))
        {
        
GetPlayerName(playeridsendernamesizeof(sendername));
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' '))
        {
            
idx++;
        }
        new 
offset idx;
        new 
result[64];
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
        {
            
result[idx offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx offset] = EOS;
        
result[0] = toupper(result[0]);
        if(!
strlen(result))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: (/tc)[TC chat]");
            return 
1;
        }
        if(
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
        {
            if(
PlayerInfo[playerid][pRank] == 6) { format(stringsizeof(string), "** Patron %s: %s, over. **"sendernameresult); }
            else if(
PlayerInfo[playerid][pRank] == 5) { format(stringsizeof(string), "** Under-Boss %s: %s, over. **"sendernameresult); }
            else if(
PlayerInfo[playerid][pRank] == 4) { format(stringsizeof(string), "** Manager %s: %s, over. **"sendernameresult); }
            else if(
PlayerInfo[playerid][pRank] == 3) { format(stringsizeof(string), "** Senior-Mechanic %s: %s, over. **"sendernameresult); }
            else if(
PlayerInfo[playerid][pRank] == 2) { format(stringsizeof(string), "** Mechanic %s: %s, over. **"sendernameresult); }
            else if(
PlayerInfo[playerid][pRank] == 1) { format(stringsizeof(string), "** Vulcanizator %s: %s, over. **"sendernameresult); }
            else
            {
                
format(stringsizeof(string), "** Vulcanizator %s: %s, over. **"sendernameresult);
            }
            
SendRadioMessage(1TEAM_SEA_COLORstring);
            
printf("%s"string);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GRAD2"   Nu faceti parte de TCC !");
            return 
1;
        }
        }
        return 
1;
        } 
Reply
#2

pawn Код:
if (PlayerInfo[playerid][pMember] != 16 || PlayerInfo[playerid][pLeader] != 16) return SendClientMessage(playerid, COLOR_GREY, "   You are not a Car Mechanic!");
I take it 16 is mech
Reply
#3

?yes id 16 is mechanic..
Reply
#4

Then you need to do != instead of ==

!= is not equal
== is equal


https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply
#5

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
pawn Код:
if (PlayerInfo[playerid][pMember] != 16 || PlayerInfo[playerid][pLeader] != 16) return SendClientMessage(playerid, COLOR_GREY, "   You are not a Car Mechanic!");
I take it 16 is mech
was this the wright cmd if it was no work..its the same no errors...
Reply
#6

Oh I know why...Remove the pLeader from it

If they're pLeader they should still be pMember right?
Reply
#7

off ( same..i cant take it anymore..
Reply
#8

anyone know?
Reply
#9

helloo anyone can help me please?i dont like waiting..
Reply
#10

And we don't like bumping!

Okay, please answer this question carefully and clear:

What is the exact problem now and what do you want?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)