Command Request
#1

How to create this command in
/prison [ID/Name of Player] [Minutes]
pawn Код:
//-----------------------------------[PRISON]-------------------------------------------------------------------------
    if(strcmp(cmd, "/prison",true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 2)
            {
                SendClientMessage(playerid, WHITE, ""COL_RED"|CityBot|{FFFFFF} Niste ovlasteni da koristite tu komandu.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /prison [ID Igraca/Deo Imena]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerNameEx(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* Stavili ste {48E31C}%s-a u "COL_WHITE"Areu-51.", giveplayer);
                    SendClientMessage(playerid, ZELENKASTA, string);
                    format(string, sizeof(string), "* Admin {48E31C}%s "COL_WHITE"vas je stavio u {48E31C}Areu-51.", sendername);
                    SendClientMessage(giveplayerid, ZELENKASTA, string);
                    GameTextForPlayer(giveplayerid, "~w~Dobrodosli u ~n~~r~Area-51", 5000, 3);
                    WantedPoints[giveplayerid] = 0;
                    WantedLevel[giveplayerid] = 0;
                    PlayerInfo[giveplayerid][pJailed] = 2;
                    PlayerInfo[giveplayerid][pJailTime] = 3600;
                    SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
                    SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
                    SetPlayerInterior(giveplayerid,0);
                    PlayerInfo[giveplayerid][pInt] = 0;
                    format(string, 256, ""COL_RED"|CityBot|{FFFFFF} %s "COL_WHITE"je zatvoren od Admin "COL_RED"%s.", giveplayer, sendername);
                    ABroadCast(COLOR_WHITE,string,1);
                    format(string, sizeof(string), "Area51 | %s je stavljen u areu od %s-a", giveplayer, sendername);
                    printf("%s",string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Igrac je offline!");
                return 1;
            }
        }
        return 1;
    }
Reply
#2

Why did you post a already made command? It is not working? Or you want it changed to other command processor? I'm confused.
Reply
#3

you are nuts !!!
y wan't this command in /prison [ID/Name of Player] [time]
[time] TO CLOSE THE PLAYER IN JAIL IN MINUTES/HOUR TO SET HIM ADMIN IN JAIL !!!
Reply
#4

Download zcmd.inc from filterscript and includes section of the forum. And add the file in your server folder. Here. "serverfolder>pawno>includes>copy and paste the file to this folder called includes which was inside pawno folder."

If this command is not right. Tell me what do you exactly want us to change in your current command?

This is how youre command will be using ZCMD:

pawn Код:
//-----------------------------------[PRISON]-------------------------------------------------------------
// YOUR CMD USING ZCMD Command Processor [Credits: Zeex]
    CMD:prison(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            new id,time;                          
            if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, WHITE, ""COL_RED"|CityBot|{FFFFFF} Niste ovlasteni da koristite tu komandu.");
            if(sscanf(params, "ud", id, time)) return SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /prison [ID Igraca/Deo Imena]");
            if(IsPlayerConnected(id))
            {
                if(id != INVALID_PLAYER_ID)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    GetPlayerNameEx(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* Stavili ste {48E31C}%s-a u "COL_WHITE"Areu-51.", giveplayer);
                    SendClientMessage(playerid, ZELENKASTA, string);
                    format(string, sizeof(string), "* Admin {48E31C}%s "COL_WHITE"vas je stavio u {48E31C}Areu-51.", sendername);
                    SendClientMessage(id, ZELENKASTA, string);
                    GameTextForPlayer(id, "~w~Dobrodosli u ~n~~r~Area-51", 5000, 3);
                    WantedPoints[id] = 0;
                    WantedLevel[id] = 0;
                    PlayerInfo[id][pJailed] = 2;
                    PlayerInfo[id][pJailTime] = 3600;
                    SetPlayerPos(id, 107.2300,1920.6311,18.5208);
                    SetPlayerWorldBounds(id, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
                    SetPlayerInterior(id,0);
                    PlayerInfo[id][pInt] = 0;
                    format(string, 256, ""COL_RED"|CityBot|{FFFFFF} %s "COL_WHITE"je zatvoren od Admin "COL_RED"%s.", giveplayer, sendername);
                    ABroadCast(COLOR_WHITE,string,1);
                    format(string, sizeof(string), "Area51 | %s je stavljen u areu od %s-a", giveplayer, sendername);
                    printf("%s",string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Igrac je offline!");
                return 1;
            }
        }
        return 1;
    }
Reply
#5

y use strcmp
-give me the download link and y will test it becouse y use 1 time zcmd and where to put this zcmd ?"?
Reply
#6

Click here for the Download Link

1.The folder which contains all server files. There will be one more folder "pawno". Open it.
2.There will be one more folder "include". Open it also and paste the zcmd.inc file you downloaded from that link.
Reply
#7

ok thanks for the link,now where to put the zcmd ?
Reply
#8

put zcmd.inc inside pawno/include then

put this inside your script after the #include

pawn Код:
#include <zcmd>
Reply
#9

Quote:
Originally Posted by RollTi
Посмотреть сообщение
put zcmd.inc inside pawno/include then

put this on the top of your game mode just below this line #include <a_samp>

pawn Код:
#include <zcmd> // Add this line just below #include <a_samp>
I forgot to mention that too. That is an important step. Thanks RollTi.
Reply
#10

where to put the cmd ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)