Ajail command problem.
#1

PHP код:
    //ajail Command
        
    
if(strcmp(cmd"/ajail"true) == 0)
    {
     if(
IsPlayerAdmin(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
                return 
1;
            }
            new 
playa;
            new 
money;
line132            playa ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            
money strval(tmp);
Line135            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(playagiveplayersizeof(giveplayer));
                        
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;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
                            return 
1;
                        }
                        
format(stringsizeof(string), "* You Jailed %s."giveplayer);
                        
SendClientMessage(playeridCOLOR_LIGHTREDstring);
                        
format(stringsizeof(string), "* You were Jailed by Admin %s."sendername);
                        
SendClientMessage(playaCOLOR_LIGHTREDstring);
                        
SafeResetPlayerWeapons(playa);
                        
WantedPoints[playa] = 0;
                        
PlayerInfo[playa][pJailed] = 1;
                        
PlayerInfo[playa][pJailTime] = money*60;
                        
SetPlayerInterior(playa6);
                        
PlayerInfo[playa][pInt] = 6;
                        
SetPlayerPos(playa264.6288,77.5742,1001.0391);
                        
format(stringsizeof(string), "You are jailed for %d minutes.   Bail: Unable"money);
                        
SendClientMessage(playaCOLOR_WHITEstring);
                        
format(string256"AdmCmd: %s has been jailed by Admin %s [Reason: %s]"giveplayersendername, (result));
                        
BroadCast(COLOR_LIGHTRED,string);
                        
format(stringsizeof(string), "AdmCmd: %s has been Admin-jailed by %s [Reason: %s]"giveplayersendername, (result));
                        
printf("%s",string);
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   you are not authorized to use that command!");
            }
        }
        return 
1;
    } 
Errors :
PHP код:
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(132) : error 006must be assigned to an array
C:\Documents and Settings\y\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(135) : error 029invalid expressionassumed zero
C
:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(135) : warning 215expression has no effect
C
:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(135) : error 001expected token";"but found "]"
C:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(135) : error 029invalid expressionassumed zero
C
:\Documents and Settings\\My Documents\Downloads\samp03bsvr_R2_win32\filterscripts\base.pwn(135) : fatal error 107too many error messages on one line 
Reply
#2

If you're going to copy and paste out of other game modes, atleast learn how to copy and paste the whole code needed.
Reply
#3

I was editing a new command, I didn't copy, I took it from some Pwn File.
Can you help me ?
Reply
#4

Anyone ? please.
Reply
#5

Go and learn ZCMD and SSCANF...

If you spend less time copying and pasting and more time looking over tutorials...you would be able to make this command yourself... Using simple features like Zcmd and Sscanf, you can make this very quickly and easily.
Reply
#6

If you copy and paste please copy some defines at the first lines ! Maybe some strocks!
Reply
#7

This is the third time I have attached this link to my posts today...

Please do us all (and yourself) a favor by visiting the SA-MP Wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)