[HELP] Can someone help me with this script
#1

Hi everyone,
I have downloaded Vortex roleplay script, and i tryed to make a /mir command.
It works but not good... it only say's to the other player this sentence:

"You have the right to a Phone Call, but only to ONE. Did you understood your rights?"
but it have to say all the 3 sentences.

Please someone help!!

Below is the script....

Код:
command(mir, playerid, params[])
{
        new id, string[128];
        if(sscanf(params, "u", id))
        {
                SendClientMessage(playerid, WHITE, "SYNTAX: /mir [playerid]");
        }
        else
        {
            if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
            {
                if(Player[id][Tazed] == 1)
                {
                    if(GetDistanceBetweenPlayers(playerid, id) < 7)
                    {
                        TogglePlayerControllable(id, true);
                        ApplyAnimation(id, "ped", "cower", 1, 1, 0, 0, 0, 0);
                        Player[id][Cuffed] = 0;
                        Player[id][Tazed] = 0;
                        format(string, sizeof(string), "* %s has said the mir rights to %s.", GetName(playerid), GetName(id));
                        NearByMessage(playerid, NICESKY, string);
                        format(string, sizeof(string), "You have said the mir rights to %s.", GetName(id));
                                        SendClientMessage(playerid, WHITE, string);
                        format(string, sizeof(string), "You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Lawyer, If you cannot afford one, the state will appoint you one", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Phone Call, but only to ONE. Did you understood your rights?", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                                        TogglePlayerControllable(id, true);
                    }
                    else
                    {
                        SendClientMessage(playerid, WHITE, "You're too far away!");
                    }
                }
                else
                {
                    if(GetDistanceBetweenPlayers(playerid, id) < 7)
                    {
                        if(GetPlayerSpecialAction(id) == SPECIAL_ACTION_HANDSUP)
                        {
                            TogglePlayerControllable(id, true);
                                ApplyAnimation(id, "ped", "cower", 1, 1, 0, 0, 0, 0);
                                Player[id][Cuffed] = 0;
                                Player[id][Tazed] = 0;
                                format(string, sizeof(string), " %s has said the mir rights to %s.", GetName(playerid), GetName(id));
                        NearByMessage(playerid, NICESKY, string);
                        format(string, sizeof(string), "You have said the mir rights to %s.", GetName(id));
                                        SendClientMessage(playerid, WHITE, string);
                        format(string, sizeof(string), "You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Lawyer, If you cannot afford one, the state will appoint you one", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Phone Call, but only to ONE. Did you understood your rights?", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                                        TogglePlayerControllable(id, true);
                        }
                    }
                }
            }
        }
        return 1;
}
Thanks for helping
Reply
#2

which three sentences i don't understand ...
Reply
#3

Try this :
Код:
command(mir, playerid, params[])
{
        new id, string[128];
        if(sscanf(params, "u", id))
        {
                SendClientMessage(playerid, WHITE, "SYNTAX: /mir [playerid]");
        }
        else
        {
            if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
            {
                if(Player[id][Tazed] == 1)
                {
                    if(GetDistanceBetweenPlayers(playerid, id) < 7)
                    {
                        TogglePlayerControllable(id, true);
                        ApplyAnimation(id, "ped", "cower", 1, 1, 0, 0, 0, 0);
                        Player[id][Cuffed] = 0;
                        Player[id][Tazed] = 0;
                        format(string, sizeof(string), "* %s has said the mir rights to %s.", GetName(playerid), GetName(id));
                        NearByMessage(playerid, NICESKY, string);
                        format(string, sizeof(string), "You have said the mir rights to %s.", GetName(id));
                                        SendClientMessage(playerid, WHITE, string);
                        format(string, sizeof(string), "You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                        format(string, sizeof(string), "You have the right to a Lawyer, If you cannot afford one, the state will appoint you one", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                        format(string, sizeof(string), "You have the right to a Phone Call, but only to ONE. Did you understood your rights?", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                                        TogglePlayerControllable(id, true);
                    }
                    else
                    {
                        SendClientMessage(playerid, WHITE, "You're too far away!");
                    }
                }
                else
                {
                    if(GetDistanceBetweenPlayers(playerid, id) < 7)
                    {
                        if(GetPlayerSpecialAction(id) == SPECIAL_ACTION_HANDSUP)
                        {
                            TogglePlayerControllable(id, true);
                                ApplyAnimation(id, "ped", "cower", 1, 1, 0, 0, 0, 0);
                                Player[id][Cuffed] = 0;
                                Player[id][Tazed] = 0;
                                format(string, sizeof(string), " %s has said the mir rights to %s.", GetName(playerid), GetName(id));
                        NearByMessage(playerid, NICESKY, string);
                        format(string, sizeof(string), "You have said the mir rights to %s.", GetName(id));
                                        SendClientMessage(playerid, WHITE, string);
                        format(string, sizeof(string), "You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Lawyer, If you cannot afford one, the state will appoint you one", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Phone Call, but only to ONE. Did you understood your rights?", GetName(playerid));
                                        SendClientMessage(id, WHITE, string);
                                        TogglePlayerControllable(id, true);
                        }
                    }
                }
            }
        }
        return 1;
}
Reply
#4

Will you explain me why are you formating messages without any string or integrer? GetName(playerid)); is very useless

Use this:
PHP код:
format(stringsizeof(string), "You have said the mir rights to %s."GetName(id));
SendClientMessage(playeridWHITEstring);
SendClientMessage(idWHITE"You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law");
SendClientMessage(idWHITE"You have the right to a Lawyer, If you cannot afford one, the state will appoint you one");
SendClientMessage(idWHITE,"You have the right to a Phone Call, but only to ONE. Did you understood your rights?"); 
Reply
#5

Quote:
Originally Posted by Mr_Scripter
Посмотреть сообщение
which three sentences i don't understand ...
Код:
format(string, sizeof(string), "You have the right to keep silence, Everything you say can be used agaisnt you in a court of the Law", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Lawyer, If you cannot afford one, the state will appoint you one", GetName(playerid));
                        format(string, sizeof(string), "You have the right to a Phone Call, but only to ONE. Did you understood your rights?", GetName(playerid));
those three
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)