SA-MP Forums Archive
What Do I Have To Do To Set GM To Midnight? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What Do I Have To Do To Set GM To Midnight? (/showthread.php?tid=158120)



Help with jail - [Weponz] - 08.07.2010

Ok i got time now i have a few problems with my jail,

I dont want it to be able to /rob /kill in jail etc.

And if thay /q in jail when thay relog thay are back in there for same time,

How may i do this


Re: What Do I Have To Do To Set GM To Midnight? - [XST]O_x - 08.07.2010

You mean like the time will be always midnight?
Add this under OnGameModeInit
pawn Код:
SetWorldTime(0);



Re: What Do I Have To Do To Set GM To Midnight? - [Weponz] - 08.07.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
You mean like the time will be always midnight?
Add this under OnGameModeInit
pawn Код:
SetWorldTime(0);
Wow Thanks Dude!


Re: What Do I Have To Do To Set GM To Midnight? - [Weponz] - 08.07.2010

Could you help me stop /kill and /rob etc in jail?


Re: What Do I Have To Do To Set GM To Midnight? - CAR - 08.07.2010

If You got the position of jail use this in your /kill and /rob:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) return 0; // 20 is the range, x,y,z are the coords of jail (I don't know)



Re: What Do I Have To Do To Set GM To Midnight? - [Weponz] - 08.07.2010

Quote:
Originally Posted by CAR
Посмотреть сообщение
If You got the position of jail use this in your /kill and /rob:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) return 0; // 20 is the range, x,y,z are the coords of jail (I don't know)
ist he x/y/z thing here orrr

SetPlayerPos(id, 198.1103,175.2664,1003.0234);??


Re: What Do I Have To Do To Set GM To Midnight? - [XST]O_x - 08.07.2010

Okay,I see you have a cops and robbers server right?
That's pretty simple =P
pawn Код:
enum pInfo
{
    Jailed
};

new PlayerInfo[MAX_PLAYERS][pInfo];
Okay now,under your arrest command after all SetPlayerPos(id,JailPositions..) add this:

pawn Код:
PlayerInfo[id][Jailed] = 1;
And now /kill and /rob

pawn Код:
if(strcmp(cmd, "/kill", true) == 0)
    {
            if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,color,"You cannot kill yourself while you're jailed!");
            else return SetPlayerHealth(playerid,0);
            return 1;
        }
        if(strcmp(cmd, "/rob", true) == 0)
    {
            if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,color,"You cannot rob someone/a store while you're jailed");
            else
            {
               // Rest of your script
            }
            return 1;
        }



Re: What Do I Have To Do To Set GM To Midnight? - [Weponz] - 08.07.2010

how do i stop /ar /tk /rob etc in cars?


Re: What Do I Have To Do To Set GM To Midnight? - Hiddos - 08.07.2010

pawn Код:
if(IsPlayerInAnyVehicle(playerid)) return 1;



Re: What Do I Have To Do To Set GM To Midnight? - [Weponz] - 09.07.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Okay,I see you have a cops and robbers server right?
That's pretty simple =P
pawn Код:
enum pInfo
{
    Jailed
};

new PlayerInfo[MAX_PLAYERS][pInfo];
Okay now,under your arrest command after all SetPlayerPos(id,JailPositions..) add this:

pawn Код:
PlayerInfo[id][Jailed] = 1;
And now /kill and /rob

pawn Код:
if(strcmp(cmd, "/kill", true) == 0)
    {
            if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,color,"You cannot kill yourself while you're jailed!");
            else return SetPlayerHealth(playerid,0);
            return 1;
        }
        if(strcmp(cmd, "/rob", true) == 0)
    {
            if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,color,"You cannot rob someone/a store while you're jailed");
            else
            {
               // Rest of your script
            }
            return 1;
        }

ahh i get errors we this go:

enum pInfo
{
Jailed
};