SA-MP Forums Archive
cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: cmd (/showthread.php?tid=588030)



cmd - ammar2514 - 04.09.2015

I need a /unjail cmd =D if any one have it please paste it thanks

for example /unjail [player id] and in the chatbox players get:

Batlemos has been unjailed by [admin name]


Re: cmd - AmirHossaiN - 04.09.2015

do you have /jail command ?

if you have it, please put here for help you.


Re: cmd - Variable™ - 04.09.2015

Wrong section.


Re: cmd - ammar2514 - 04.09.2015

http://pastebin.com/4W1H2EGG


Re: cmd - AmirHossaiN - 04.09.2015

try

PHP код:
CMD:unjail(playerid,params[])
{
        new 
string[128];
        new 
ID;
        new 
cmdtime;
        new 
cmdreason[256];
        if(
AdminLevel[playerid] < 1) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command.");
        if(
sscanf(params"u"ID))
        {
            
SendClientMessage(playerid,COLOR_WHITE,""COL_USAGE"[SYNTAX] {FFFFFF}/unjail [PLAYER_ID]");
            return 
1;
        }
        if(!
IsPlayerConnected(ID))
        {
            
format(string,sizeof(string),"{AFAFAF}[Error]: {FFFFFF}Invalid player ID.");
            
SendClientMessage(playerid,COLOR_WHITE,string);
            return 
1;
        }
        if(
JailTime[ID] == 0) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}he/she is not in jail.");
        
format(string,sizeof(string),"%s has been unjailed by admin %s",PlayerName(ID),PlayerName(playerid));
        
SendALogMessage(string);
 
    
JailTime[ID] = 0;
    
IsCuffed[ID] = 0;
    
CuffTime[ID] = 0;
    
    
// Use unjail postition
    
SetPlayerInterior(ID,10);
    
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
    
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
    
//
    
    
TogglePlayerControllable(ID1);
    
SetPlayerToTeamColour(ID);
    
SetPlayerHealth(ID100.0);
    
SetPlayerArmour(ID0);
    return 
1;
 




Re: cmd - ammar2514 - 04.09.2015

getting errors while compiling:

C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(8667) : warning 217: loose indentation
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(8673) : error 017: undefined symbol "rnd"
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(8674) : error 017: undefined symbol "rnd"
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(8650) : warning 204: symbol is assigned a value that is never used: "cmdreason"
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(8649) : warning 203: symbol is never used: "cmdtime"
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(11050) : warning 202: number of arguments does not match definition
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(11056) : warning 202: number of arguments does not match definition
C:\Users\Ammar_01\Documents\My Server\gamemodes\CopsandRobbers.pwn(17793) : warning 204: symbol is assigned a value that is never used: "message"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Re: cmd - ammar2514 - 04.09.2015

the line

SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);


Re: cmd - AmirHossaiN - 04.09.2015

PHP код:
 // Use unjail postition 
    
SetPlayerInterior(ID,10); 
    
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]); 
    
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]); 
    
// 
Change these for your unjail position


Re: cmd - ammar2514 - 04.09.2015

still getting the error for (rnd)


Re: cmd - AmirHossaiN - 05.09.2015

use this for example:

SetPlayerInterior(ID,0);
SetPlayerPos(ID,0,0,2);
SetPlayerFacingAngle(ID,180.0);