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(cmdtext, idx);
        if(!
strlen(tmp)) {
            
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeciv [playerid/PartOfName] ");
            return 
1;
        }
        new 
para1;
        
para1 = ReturnUser(tmp);
        
tmp = strtok(cmdtext, idx);
         if (
RankRequire(playerid)) {
            if(
PlayerInfo[playerid][pMember] == 1) {
            if(
IsPlayerConnected(para1)) {
                if(
para1 != INVALID_PLAYER_ID) {
                 if(
PlayerInfo[para1][pGuard] == 1) {
                    
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                    
GetPlayerName(playerid, sendername, sizeof(sendername));
                    
GiveNameSpace(sendername);
                    
GiveNameSpace(giveplayer);
                    
PlayerInfo[para1][pGuard] = 0;
                    
PlayerInfo[para1][pModel] = 47;
                    
SetPlayerSkinEx(para1,47);
                    
format(string, sizeof(string), "   You have been demoted to a regular civilian by: %s", sendername);
                    
SendClientMessage(para1, COLOR_WHITE, string);
                    
format(string, sizeof(string), "You have been demoted %s to a regular civilian", giveplayer);
                    
SendClientMessage(playerid, COLOR_WHITE, string);
                    }
                    }
                }
            }                                     
//not connected
        
}
        else {
            
SendClientMessage(playerid, COLOR_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(cmdtext, idx);
        if(!
strlen(tmp)) {
            
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givedrivelicense [playerid/PartOfName] ");
            return 
1;
        }
        new 
para1;
        
para1 = ReturnUser(tmp);
        
tmp = strtok(cmdtext, idx);
         if (
RankRequire(playerid)) {
            if(
PlayerInfo[playerid][pMember] == 20) {
            if(
IsPlayerConnected(para1)) {
                if(
para1 != INVALID_PLAYER_ID) {
                    
PlayerInfo[para1][pDrivLic] = 1;
                    
format(string, sizeof(string), "   %s give you a drive license", sendername);
                    
SendClientMessage(para1, COLOR_WHITE, string);
                    
format(string, sizeof(string), "You give drive license to %s", giveplayer);
                    
SendClientMessage(playerid, COLOR_WHITE, string);


                    }
                }
            }                                     
//not connected
        
}
        else {
            
SendClientMessage(playerid, COLOR_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)