Jump to content

Question

Posted

Cum fac cand esti inchis in puscarie  sa nu poti folosi nici`o teleportare/comanda!

Comanda este aceasta!

[pawn]CMD:jail(playerid,params[])

{

if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Level] <= 3)

{

new jtime, tmp3[50], player1, string[128];

//------------------------------------------------------------------

if(sscanf(params, "uIS()[50]", player1, jtime, tmp3)) return

SendClientMessage(playerid, LIGHTBLUE2, "Usage: /jail [PlayerID] [Minutes] [Reason]") &&

SendClientMessage(playerid, orange, "Function: Will Jailed the specified player");

//------------------------------------------------------------------

if(PlayerInfo[player1][Jailed] == 0)

{

if(jtime == 0) jtime = 9999;

//----------------------------------------------------------

PlayerInfo[player1][JailTime] = jtime*1000*60;

    SetTimerEx("JailPlayer", 5000, false, "i", player1);

    SetTimerEx("Jail1", 1000, false, "i", player1);

    PlayerInfo[player1][Jailed] = 1;

    SetPVarInt(player1, "Jailed", 1);

//----------------------------------------------------------

if(jtime == 9999)

{

if(!strlen(tmp3))

{

format(string, 128,"Administrator %s has Jailed %s",GetName(playerid), GetName(player1));

}

else format(string, 128,"Administrator %s has Jailed %s (Reason: %s)",GetName(playerid), GetName(player1), tmp3);

  }

else

{

if(!strlen(tmp3))

{

format(string, 128,"Administrator %s has Jailed %s for %d Minutes",GetName(playerid), GetName(player1), jtime);

}

else format(string, 128,"Administrator %s has Jailed %s for %d Minutes (Reason: %s)",GetName(playerid), GetName(player1), jtime,tmp3);

}

    return SendClientMessageToAll(blue,string);

}

else return SendClientMessage(playerid, red, "ERROR: Player is already in jail");

}

else return SendClientMessage(playerid,red,"ERROR: You must be Admin lvl 4 to use this command");

}

[/pawn]

14 answers to this question

Recommended Posts

Posted

La OnPlayerCommandPerformed pune

if(PlayerInfo[player1][Jailed] == 1) return SendClientMessage( playeri, -1, "Nu poti folosi comenzi in timp ce esti la inchisoare." );

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Posted

[pawn]if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage( playerid, -1, "Nu poti folosi comenzi in timp ce esti la inchisoare." );[/pawn]

Ar trebui sa mearga

PS:NexT, tu ai pus la OnPlayerCommandPerformed player1, si trebuia playerid!

Rate me :)

Posted

Nu merge , scrie ;;Nu poti folosi comenzi in timp ce esti la inchisoare;; si cand folosesc comanda /jail id timp ... si cand st in inchisoare si dau /ls ... dar se teleporteaza .. cum fac sa nu mai iese deloc din inchisore pana cand nu expira timpul?

Posted

Buna seara alinutz_boy32

Am analizat problema ta si raspunsurile colegilor mei.Incearca te rog sa pui urmatorul cod si sa revii cu un 'reply' pentru informarea noastra daca aceasta metoda a functionat sau nu.

[pawn]public OnPlayerCommandReceived(playerid, cmdtext[])

{

    if(jailed[playerid] == 1)

    {

      SendClientMessage(playerid,COLOR_WHITE,"Nu poti folosi aceasta comanda in timp ce esti in jail");

      return 0;

    }

    return 1;

}[/pawn]

HINT:In caz ca public OnPlayerCommandReceived(playerid, cmdtext[])nu este prezenti in scriptul tau,poti adauga tot codul de mai sus.

Sper ca ti-am fost de folos,

Onica Razvan

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

Posted

[pawn]D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : error 028: invalid subscript (not an array or too many subscripts): "Jailed"

D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : warning 215: expression has no effect

D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : error 001: expected token: ";", but found "]"

D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : error 029: invalid expression, assumed zero

D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

[/pawn]

4 Errors.

Posted

public OnPlayerCommandReceived(playerid, cmdtext[])

{

    if(PlayerInfo[playerid][Jailed]] == 1)

    {

      SendClientMessage(playerid,COLOR_WHITE,"Nu poti folosi aceasta comanda in timp ce esti in jail");

      return 0;

    }

    return 1;

}

Rate me :)

Posted

[pawn]public OnPlayerCommandReceived(playerid, cmdtext[])

{

    if(PlayerInfo[playerid][Jailed]] == 1)

    {

      SendClientMessage(playerid,COLOR_WHITE,"Nu poti folosi aceasta comanda in timp ce esti in jail");

      return 0;

    }

    return 1;

}[/pawn]

D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1553) : error 025: function heading differs from prototype
D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1553) : error 029: invalid expression, assumed zero
D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1555) : error 010: invalid function or declaration
D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1558) : error 010: invalid function or declaration
D:\New  Romania Play Stunt!\gamemodes\RST.pwn(1560) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Posted

public OnPlayerCommandReceived(playerid, cmdtext[])

{

    if(PlayerInfo[playerid][Jailed] == 1)

    {

      SendClientMessage(playerid,COLOR_WHITE,"Nu poti folosi aceasta comanda in timp ce esti in jail");

      return 0;

    }

    return 1;

}

Rate me :)

Posted

Rezolvat, dar acum cum fac ..la /unjail sa iese din puscaire! indiferent de timp!

[pawn]CMD:unjail(playerid,params[]) {

    if(sscanf(params, "u", playerid)) return SendClientMessage(playerid, -1, "{0062FF}Utilizare Comanda{FFFFFF}: /ajail [playerid] ");

if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Playerul nu este {30a030}Online{FFFFFF}.");

    if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid, -1, "{FFFFFF}^ {24BBFF}Stunt{F65205}Zone{BCFF12}Bacau{FFFFFF}^ Ne pare rau dar nu aveti permisiunea sa folositi aceasta comanda!");

    SetPlayerPos(playerid, 1555.097900, -1675.848754, 16.195312);

    SetPlayerInterior(playerid, 0);

    return (1) ; }[/pawn]

Posted

CMD:unjail(playerid,params[])

{

    if(sscanf(params, "u", playerid)) return SendClientMessage(playerid, -1, "{0062FF}Utilizare Comanda{FFFFFF}: /ajail [playerid] ");

    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Playerul nu este {30a030}Online{FFFFFF}.");

    if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid, -1, "{FFFFFF}^ {24BBFF}Stunt{F65205}Zone{BCFF12}Bacau{FFFFFF}^ Ne pare rau dar nu aveti permisiunea sa folositi aceasta comanda!");

    PlayerInfo[playerid][Jailed] = 0;

    PlayerInfo[playerid][JailTime] = 0;

    SetPlayerPos(playerid, 1555.097900, -1675.848754, 16.195312);

    SetPlayerInterior(playerid, 0);

    return 1;

}

Rate me :)

Posted

Pai odata ce i-ai dat unjail playerului, ii va seta Jailed la 0. Cand playerul incearca o comanda de teleport, serverul va verifica daca Jailed este pe 1 si nu este. (in cazul in care ti-ai dat unjail) deci ar trebui sa il lase pe player sa se teleporteze

Rate me :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.