Can someone edit easy code?
#1

Hi everyone, i'm going to explain it quick and simple soo.. This is a code to degrade someone..
PHP код:
if(strcmp(cmd"/makeciv"true) == 0)
{
    if(
IsPlayerConnected(playerid)) {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /makeciv [playerid/PartOfName] ");
            return 
1;
        }
        new 
para1;
        
para1 ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
         if (
RankRequire(playerid)) {
            if(
PlayerInfo[playerid][pMember] == 1) {
            if(
IsPlayerConnected(para1)) {
                if(
para1 != INVALID_PLAYER_ID) {
                 if(
PlayerInfo[para1][pGuard] == 1) {
                    
GetPlayerName(para1giveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
GiveNameSpace(sendername);
                    
GiveNameSpace(giveplayer);
                    
PlayerInfo[para1][pGuard] = 0;
                    
PlayerInfo[para1][pModel] = 47;
                    
SetPlayerSkinEx(para1,47);
                    
format(stringsizeof(string), "   You have been demoted to a regular civilian by: %s"sendername);
                    
SendClientMessage(para1COLOR_WHITEstring);
                    
format(stringsizeof(string), "You have been demoted %s to a regular civilian"giveplayer);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    }
                    }
                }
            }                                     
//not connected
        
}
        else {
            
SendClientMessage(playeridCOLOR_GRAD1"   you are not authorized to use that command!");
        }
    }
    return 
1;

I tried to edit this 100's of time but keep on failing. What im trying to do is edit this so that a [pMember] == 20 can edit someones driving licence which is [pDrivLic] and set the value to 1.

I know how to to do it in ZCMD, but this is completely different and i need to use this

Could anyone edit this for me and explain how he did it? Would be very thankful and obviously +rep for help
Reply
#2

anyone pleasee?
Reply
#3

PHP код:
if(strcmp(cmd"/givedrivelicense"true) == 0)
{
    if(
IsPlayerConnected(playerid)) {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /givedrivelicense [playerid/PartOfName] ");
            return 
1;
        }
        new 
para1;
        
para1 ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
         if (
RankRequire(playerid)) {
            if(
PlayerInfo[playerid][pMember] == 20) {
            if(
IsPlayerConnected(para1)) {
                if(
para1 != INVALID_PLAYER_ID) {
                    
PlayerInfo[para1][pDrivLic] = 1;
                    
format(stringsizeof(string), "   %s give you a drive license"sendername);
                    
SendClientMessage(para1COLOR_WHITEstring);
                    
format(stringsizeof(string), "You give drive license to %s"giveplayer);
                    
SendClientMessage(playeridCOLOR_WHITEstring);


                    }
                }
            }                                     
//not connected
        
}
        else {
            
SendClientMessage(playeridCOLOR_GRAD1"   you are not authorized to use that command!");

        }
    }
    return 
1;

Like that ?

Rep+ if i help you
Reply
#4

Thank you very much, i'm going to test it right now and +rep
Reply
#5

So, does it work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)