SA-MP Forums Archive
YCMD help :$ - 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: YCMD help :$ (/showthread.php?tid=303457)



YCMD help :$ - FireCat - 13.12.2011

Like when someone uses some command for example /kill, it allows them, even if they are jailed.
I'm jailed and I use /kill, it says "You have suicided" but after that, it sends "Server:Unknown command", but I just want to prevent him from using /kill while jailed.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    for(new i, f = Robplaces; i < f; i++)
    {
        if(strcmp(cmdtext,RobCMDS[i]) == 0 && IsPlayerInRangeOfPoint(playerid, 5,RobPos[i][0],RobPos[i][1],RobPos[i][2]))
        {
            if(PInfo[playerid][RobbedStore] == 1) return SendClientMessage(playerid, Red, "« Error » "lyellow"You have recently robbed a store, please wait");
            GameTextForPlayer(playerid,"~r~~h~Time left: 10",4000,3);
            SendClientMessage(playerid, Red,"» "lorange"You have started a robbery... Please stay in the radius of this place");
            RobbingTimer[playerid] = SetTimerEx("Robbing",1000,true,"i",playerid);
            RobbingID[playerid] = i;
            RobbingTimeLeft[playerid] = 10;
            return 1;
        }
    }
    if(PInfo[playerid][Jailed] == 1 && strcmp(cmdtext,"/escape") != 0)
    {
        SendClientMessage(playerid,Red,"You can't use commands in jail.");
        return 0;
    }
    else if(success)
    {
        return 1;
    }
    return -1;
}



Re: YCMD help :$ - Ballu Miaa - 13.12.2011

Add this in your /kill command.
if(PInfo[playerid][Jailed] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"You cannot use this command while in Jail");
return 1;
}


Re: YCMD help :$ - FireCat - 13.12.2011

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Add this in your /kill command.
if(PInfo[playerid][Jailed] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"You cannot use this command while in Jail");
return 1;
}
No shit sherlock.
But I have a big list of commands, and its not just the kill command I want to block.
It's all of them except /escape, I dont want to go through every command, adding them.


Re: YCMD help :$ - Ballu Miaa - 13.12.2011

Then add it in the starting of your OnPlayerCommandtext. So that he wont be able to use any command in Jail. Past the one's you want him to use above this particular if then Sherlock.

Your attitude is = that you'r perfect in scripting and want no additional help!


Re: YCMD help :$ - TheArcher - 13.12.2011

Quote:
Originally Posted by FireCat
Посмотреть сообщение
No shit sherlock.
But I have a big list of commands, and its not just the kill command I want to block.
It's all of them except /escape, I dont want to go through every command, adding them.
He tried to help your request instead. You should stop saying bullsh**s and being banned for the 2645th time.


Re: YCMD help :$ - FireCat - 13.12.2011

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Then add it in the starting of your OnPlayerCommandtext. So that he wont be able to use any command in Jail. Past the one's you want him to use above this particular if then Sherlock.

Your attitude is = that you'r perfect in scripting and want no additional help!
Sorry, but YCMD, is not compatible with the callback "OnPlayerCommandText", because its already being used.


Re: YCMD help :$ - Ballu Miaa - 13.12.2011

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Sorry, but YCMD, is not compatible with the callback "OnPlayerCommandText", because its already being used.
Yeah right. Please wait for further replies. Maybe im not good enough to help you. But i tried, Thats all i know.
Its okay! All good bro, AS long as your learn from your mistakes, In real life or even in Internet world!

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
He tried to help your request instead. You should stop saying bullsh**s and being banned for the 2645th time.
Lets just keep that aside for now brother. I dont want to flame this thing in here.


Re: YCMD help :$ - TheArcher - 13.12.2011

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Sorry, but YCMD, is not compatible with the callback "OnPlayerCommandText", because its already being used.
Not because is not compatibile but beacuse it's already called. Did you hear about hook?


Re: YCMD help :$ - Slice - 13.12.2011

pawn Код:
if (PlayerDidNickalertSliceOnIRC(playerid))
    Ban(playerid);



Re: YCMD help :$ - FireCat - 13.12.2011

Quote:
Originally Posted by Slice
Посмотреть сообщение
pawn Код:
if (PlayerDidNickalertSliceOnIRC(playerid))
    Ban(playerid);
Stop trolling --'