SendRconCommand
#1

Hi

I have an vehicle ownership
And when i do /rcon login MYPASS
then
/vcreate 411 10000 1 1
it Works

And look what i want to do with this command in Script
i wanna on play Clicks Buy in dialog
to send that command
But i tryed and dont work

Any suggestions ?


Код:
#include <a_samp>

#define red 0xFF0000FF

new pickup;


public OnGameModeInit()
{
    pickup = CreatePickup(1240, 23, -2059.2109, -91.5216, 35.3203, -1);
    return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup)
    {
       ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX, "Car","Infernus 10000 LT","Buy", "Close");
    }
    return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 999)
    {
    if(response)
    {
    if(GetPlayerMoney(playerid) > 10000)
    {
    SendRconCommand("vcreate 411 10000 1 1");
    }
    else
    {
        SendClientMessage(playerid, red, "Error:You need more cash to do this.");
    }
    }
    }
    return 1;
}
Reply
#2

Show us the filterscript that contains the /vcreate command.
Reply
#3

lol vcreate is not a rcon cmd it's a cmd in that fs but while using that cmd by a player it check the player is rcon logged admin - https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Reply
#4

pawn Код:
SendRconCommand("vcreate 411 10000 1 1");
This is not the correct use of SendRconCommand

In ZCMD, we can do it like
pawn Код:
cmd_vcreate(playerid, params);
And I'm not sure if you can change params to "411 10000 1 1".
Reply
#5

Here The FS to /vcreate : https://sampforum.blast.hk/showthread.php?tid=222233
Reply
#6

If i delete This line from script


if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be admin to use this command!");


Will it work ?
it compiles
Reply
#7

It will work but the cmd : /vcreate can be used by everyone
Reply
#8

But still you can't use sendrconcommand

You must use the cmd without send rcon cmd line you have to use it directly or you have to tell the script to execute that cmd vcreate like : if it is using dcmd then you have to do dcmd_vcreate bla bla
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)