Results 1 to 5 of 5
  1. #1
    SwitchBot's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    140
    Reputation
    10
    Thanks
    5

    [FSoD] Command Help

    Hi, so I had recently made a pet renamer command, but instead of renaming the pet that you have, it renames all of your pets. How would I change this to make it only that one pet?

     

    internal class petNameCommand : Command
    {
    public petNameCommand() : base("petName", 3) { }
    protected override bool Process(Player player, RealmTime time, string[] args)
    {
    if (args.Length > 1)
    {
    player.SendHelp("Usage: /petname <newname>");
    return false;
    }
    player.Manager.Database.DoActionAsync(db =>
    {
    var cmd = db.CreateQuery();
    cmd.CommandText = "UPDATE pets SET skinName=@skinName WHERE accId=@accId";
    cmd.Parameters.AddWithValue("@skinName", args[0]);
    cmd.Parameters.AddWithValue("@accId", player.AccountId);
    if (cmd.ExecuteNonQuery() == 0)
    {
    player.SendError("Your pet name could not be changed!");
    }
    else
    {
    player.SendInfo("Your pet name was successfully changed to " + args[0] + "! Please disconnect or relog for the process to complete.");
    }
    });
    return true;
    }
    }
    Last edited by SwitchBot; 08-27-2016 at 11:23 AM.

  2. #2
    KillerViking's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    111
    Reputation
    10
    Thanks
    15
    I think realms resolutions has a pet renamer cmd

  3. #3
    Desire's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Insert Name Here
    Posts
    1,039
    Reputation
    58
    Thanks
    1,394
    My Mood
    Amused
    You cant unless you have the pet id and the accid to go withit
    im not really back nor will i ever get back into developing pservers
    though ill check once every month atleast


     

  4. The Following User Says Thank You to Desire For This Useful Post:

    MikeRaarupBirk (08-27-2016)

  5. #4
    SwitchBot's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    140
    Reputation
    10
    Thanks
    5
    Quote Originally Posted by KillerViking View Post
    I think realms resolutions has a pet renamer cmd
    i cant find it in the source

    Quote Originally Posted by T View Post
    You cant unless you have the pet id and the accid to go withit
    how would i add the petId thign to the command

  6. #5
    SwitchBot's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    140
    Reputation
    10
    Thanks
    5
    I changed this part
     

    cmd.CommandText = "UPDATE pets SET skinName=@skinName WHERE accId=@accId";


    into

     

    cmd.CommandText = "UPDATE pets SET skinName=@skinName WHERE accId=@accId" AND petId=@petId;


    but i need to add something for
     

    cmd.Parameters.AddWithValue("@petId", player.);


    would it be player.petId?

Similar Threads

  1. [Help Request] [FSOD] [COMMAND] Where are the Problem?!
    By Daemonmann in forum Realm of the Mad God Private Servers Help
    Replies: 7
    Last Post: 08-28-2016, 07:10 PM
  2. [Help Request] DayZ Commander HELP Please!
    By Symboliq in forum DayZ Help & Requests
    Replies: 8
    Last Post: 07-06-2014, 09:08 PM
  3. [Help Request] VB.NET Commands (HELP REQQQQQQQQQQQUEST)
    By GM_AVA in forum Visual Basic Programming
    Replies: 9
    Last Post: 08-02-2013, 09:49 AM
  4. [Help Request] Command help
    By 110 in forum Vindictus Help
    Replies: 7
    Last Post: 11-18-2012, 05:03 PM
  5. [Help Request] PTC Command help?
    By YoungJoe in forum Combat Arms Coding Help & Discussion
    Replies: 5
    Last Post: 02-27-2012, 09:16 PM